Skip to content

Commit

Permalink
Fixes issue with optional option by code.
Browse files Browse the repository at this point in the history
  • Loading branch information
volsch committed Aug 4, 2019
1 parent ccf7599 commit e6eb75b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ public List<Option> getOptions()
@Override
public Optional<Option> getOptionalOptionByCode( @Nullable String code )
{
return delegate.getOptionalOptionByCode( code );
final Option option = delegate.getOptionalOptionByCode( code ).orElse( null );

return option == null ? Optional.empty() : Optional.of( option instanceof WritableOption ? new ImmutableOption( (WritableOption) option ) : option );
}
}

0 comments on commit e6eb75b

Please sign in to comment.