Skip to content

Commit cec3f52

Browse files
committed
...
1 parent 191f1a8 commit cec3f52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/YAMLGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ public void writeString(String text) throws IOException,JsonGenerationException
547547
_verifyValueWrite("write String value");
548548
Character style = STYLE_QUOTED;
549549
if (Feature.MINIMIZE_QUOTES.enabledIn(_formatFeatures) && !isBooleanContent(text)) {
550-
// If this string could be interpreted as a number, it must be quoted.
550+
// If this string could be interpreted as a number, it must be quoted.
551551
if (Feature.ALWAYS_QUOTE_NUMBERS_AS_STRINGS.enabledIn(_formatFeatures)
552552
&& PLAIN_NUMBER_P.matcher(text).matches()) {
553553
style = STYLE_QUOTED;
@@ -784,7 +784,7 @@ public void writeObjectId(Object id)
784784
throws IOException
785785
{
786786
// should we verify there's no preceding id?
787-
_objectId = String.valueOf(id);
787+
_objectId = (id == null) ? null : String.valueOf(id);
788788
}
789789

790790
/*

0 commit comments

Comments
 (0)