Skip to content

Commit

Permalink
Fix potential nullpointer
Browse files Browse the repository at this point in the history
  • Loading branch information
eschleb committed Apr 17, 2024
1 parent 4930bc4 commit 99ab426
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public SwitchableDefinition build(final String name) {
final SwitchableDefinition definition =new SwitchableDefinition(
propertyNameDecorator != null ? propertyNameDecorator : PrefixNameDecorator.class,
new RadioButtonGroupFieldDefinitionBuilder<Option>()
.defaultValue(getDefault(fieldOptions, selected).map(OptionEnum::getValue).orElse(null))
.defaultValue(Optional.ofNullable(fieldOptions).flatMap(options -> getDefault(options, selected)).map(OptionEnum::getValue).orElse(null))
.layout(Layout.horizontal)
.build(
Optional.ofNullable(optionPropertyNameDecorator).orElseGet(NoopNameDecorator::new).apply(name),
Expand Down

0 comments on commit 99ab426

Please sign in to comment.