Skip to content

Commit

Permalink
Fix Tokens.Value.toString on unresolved values
Browse files Browse the repository at this point in the history
It was throwing an exception trying to unwrap unresolved value
  • Loading branch information
havocp committed May 1, 2014
1 parent e5cc232 commit 44e8a92
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion config/src/main/java/com/typesafe/config/impl/Tokens.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ AbstractConfigValue value() {

@Override
public String toString() {
return "'" + value().unwrapped() + "' (" + value.valueType().name() + ")";
if (value().resolveStatus() == ResolveStatus.RESOLVED)
return "'" + value().unwrapped() + "' (" + value.valueType().name() + ")";
else
return "'<unresolved value>' (" + value.valueType().name() + ")";
}

@Override
Expand Down

0 comments on commit 44e8a92

Please sign in to comment.