Skip to content
Permalink
Browse files

Fixing #1592 (#1623)

adding null parameter check to name(), fixing the issue and being consistent with superclass behavior
  • Loading branch information
fmmmlee committed Mar 2, 2020
1 parent fa94721 commit 55acc23d8656a9fe5b19b92029a2dc7277e3765c
Showing with 3 additions and 0 deletions.
  1. +3 −0 gson/src/main/java/com/google/gson/internal/bind/JsonTreeWriter.java
@@ -130,6 +130,9 @@ private void put(JsonElement value) {
}

@Override public JsonWriter name(String name) throws IOException {
if (name == null) {
throw new NullPointerException("name == null");
}
if (stack.isEmpty() || pendingName != null) {
throw new IllegalStateException();
}

0 comments on commit 55acc23

Please sign in to comment.
You can’t perform that action at this time.