Browse Source

safeguard mapper for null values on fields that need to be json-parsed

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 2 năm trước cách đây
mục cha
commit
c151da3080

+ 3 - 3
app/src/main/java/com/nextcloud/talk/utils/LegacyUserEntityMapper.kt

@@ -44,10 +44,10 @@ object LegacyUserEntityMapper {
                 entity.baseUrl,
                 entity.token,
                 entity.displayName,
-                LoganSquare.parse(entity.pushConfigurationState, PushConfigurationState::class.java),
-                LoganSquare.parse(entity.capabilities, Capabilities::class.java),
+                entity.pushConfigurationState?.let { LoganSquare.parse(it, PushConfigurationState::class.java) },
+                entity.capabilities?.let { LoganSquare.parse(it, Capabilities::class.java) },
                 entity.clientCertificate,
-                LoganSquare.parse(entity.externalSignalingServer, ExternalSignalingServer::class.java),
+                entity.externalSignalingServer?.let { LoganSquare.parse(it, ExternalSignalingServer::class.java) },
                 entity.current,
                 entity.scheduledForDeletion
             )