adding null parameter check to name(), fixing the issue and being consistent with superclass behavior
This commit is contained in:
Matthew Lee 2020-03-02 14:57:42 -08:00 committed by GitHub
parent fa947212e0
commit 55acc23d86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,6 +130,9 @@ public final class JsonTreeWriter extends JsonWriter {
}
@Override public JsonWriter name(String name) throws IOException {
if (name == null) {
throw new NullPointerException("name == null");
}
if (stack.isEmpty() || pendingName != null) {
throw new IllegalStateException();
}