Skip to content

Commit

Permalink
Fix RuntimeTypeAdapterFactory
Browse files Browse the repository at this point in the history
Trying to use this class as is results in the type-property not being serialized into the JSON, thus it is not present on deserialization.
The fix from #712 (comment) works. No idea why this is not merged yet.
  • Loading branch information
t-oster committed Jun 28, 2022
1 parent ca4b28c commit 5e9433d
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -205,7 +205,7 @@ public RuntimeTypeAdapterFactory<T> registerSubtype(Class<? extends T> type) {

@Override
public <R> TypeAdapter<R> create(Gson gson, TypeToken<R> type) {
if (type.getRawType() != baseType) {
if (null == type || !baseType.isAssignableFrom(type.getRawType())) {
return null;
}

Expand Down

0 comments on commit 5e9433d

Please sign in to comment.