diff --git a/data/src/main/kotlin/com/alfresco/content/data/CommonRepository.kt b/data/src/main/kotlin/com/alfresco/content/data/CommonRepository.kt index d51bc464..36b290a0 100644 --- a/data/src/main/kotlin/com/alfresco/content/data/CommonRepository.kt +++ b/data/src/main/kotlin/com/alfresco/content/data/CommonRepository.kt @@ -51,8 +51,12 @@ class CommonRepository(val session: Session = SessionManager.requireSession) { } suspend fun getMobileConfigData() { - val data = MobileConfigDataEntry.with(service.getMobileConfig("https://${URL(session.account.serverUrl).host}/app-config.json")) - + var data = MobileConfigDataEntry.default() + try { + data = MobileConfigDataEntry.with(service.getMobileConfig("https://${URL(session.account.serverUrl).host}/app-config.json")) + } catch (ex: Exception) { + ex.printStackTrace() + } saveJsonToSharedPrefs(session.context, KEY_FEATURES_MOBILE, data) } diff --git a/data/src/main/kotlin/com/alfresco/content/data/MobileConfigDataEntry.kt b/data/src/main/kotlin/com/alfresco/content/data/MobileConfigDataEntry.kt index 78427485..c7ab06a0 100644 --- a/data/src/main/kotlin/com/alfresco/content/data/MobileConfigDataEntry.kt +++ b/data/src/main/kotlin/com/alfresco/content/data/MobileConfigDataEntry.kt @@ -18,6 +18,10 @@ data class MobileConfigDataEntry( featuresMobile = MobileFeatures.with(configData.featuresMobile), ) } + + fun default(): MobileConfigDataEntry { + return MobileConfigDataEntry(featuresMobile = MobileFeatures()) + } } }