Skip to content

Commit

Permalink
Merge pull request #423 from elandau/bugfix/getIfSet
Browse files Browse the repository at this point in the history
config: Fix getIfSet
  • Loading branch information
elandau committed May 21, 2019
2 parents 5075840 + f10be52 commit 2a6e2e5
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,11 @@ private <T> Optional<T> resolverScopedProperty(IClientConfigKey<T> key) {

@Override
public <T> Optional<T> getIfSet(IClientConfigKey<T> key) {
return Optional.ofNullable((T)internalProperties.get(key));
Optional<T> value = (Optional<T>)internalProperties.get(key);
if (value == null) {
return Optional.empty();
}
return value;
}

private <T> T resolveValueToType(IClientConfigKey<T> key, Object value) {
Expand Down

0 comments on commit 2a6e2e5

Please sign in to comment.