-
Notifications
You must be signed in to change notification settings - Fork 594
Open
Description
In MessageJsonAdapter#fromJson, we ignore null values with if (value == null) continue. But if the deserialized value is a List<T?> whose some element is null, we still call fieldBinding.set(builder, value).
Later, when the T message is built, immutableCopyOf("…", list) checks require(null !in result) and throws an IllegalArgumentException because the list contains a null entry.
Is it okay to open a PR that updates fromJson to skip lists where every element is null, or to only include non-null elements?
EDIT: I initially thought we could simply remove nulls, but there are cases—like repeated google.protobuf.NullValue—where null is officially permitted.
Metadata
Metadata
Assignees
Labels
No labels