mirror of
https://github.com/fankes/moshi.git
synced 2025-10-19 16:09:21 +08:00
Make generated adapters null-safe.
This is in alignment with the lookup for Java and Kotlin reflective adapters.
This commit is contained in:
@@ -59,7 +59,7 @@ final class StandardJsonAdapters {
|
||||
|
||||
JsonClass jsonClass = rawType.getAnnotation(JsonClass.class);
|
||||
if (jsonClass != null && jsonClass.generateAdapter()) {
|
||||
return generatedAdapter(moshi, type, rawType);
|
||||
return generatedAdapter(moshi, type, rawType).nullSafe();
|
||||
}
|
||||
|
||||
if (rawType.isEnum()) {
|
||||
|
Reference in New Issue
Block a user