Skip to content

Commit 0f223b7

Browse files
committed
fix: Fix NPE when appending a null String
1 parent 4cacbbb commit 0f223b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

module/jsonurl-core/src/main/java/org/jsonurl/text/JsonTextBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ default JsonTextBuilder<R> add(Enum<?> value) throws IOException {
183183
* @see #add(CharSequence, int, int, boolean)
184184
*/
185185
default JsonTextBuilder<R> add(CharSequence text) throws IOException {
186-
return add(text, 0, text.length(), false);
186+
return add(text, 0, text == null ? 0 : text.length(), false);
187187
}
188188

189189
/**

0 commit comments

Comments
 (0)