Skip to content

Commit

Permalink
SHIBUI-2270
Browse files Browse the repository at this point in the history
Bug fix for ints when no value present
  • Loading branch information
chasegawa committed Sep 8, 2022
1 parent eff2efe commit 9e1f60f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ public void serialize(ShibPropertySetting sps, JsonGenerator generator, Serializ
generator.writeBooleanField("propertyValue", Boolean.valueOf(sps.getPropertyValue()));
break;
case "number":
generator.writeNumberField("propertyValue", Long.parseLong(sps.getPropertyValue()));
try {
generator.writeNumberField("propertyValue", Long.parseLong(sps.getPropertyValue()));
} catch (NumberFormatException notANumber) {
generator.writeStringField("propertyValue", sps.getPropertyValue());
}
break;
default:
generator.writeStringField("propertyValue", sps.getPropertyValue());
Expand Down

0 comments on commit 9e1f60f

Please sign in to comment.