Skip to content

Commit 291e402

Browse files
committed
fix: add nullability to productName property to avoid crashes when it doesn't exist in the JSON response
1 parent 503cc81 commit 291e402

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/appregistry/responses/AppRegistryResponse.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ data class AppRegistryMimeTypeResponse(
5353
data class AppRegistryProviderResponse(
5454
val name: String,
5555
@Json(name = "product_name")
56-
val productName: String,
56+
val productName: String?,
5757
val icon: String,
5858
)

owncloudData/src/main/java/com/owncloud/android/data/appregistry/datasources/implementation/OCRemoteAppRegistryDataSource.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
*
44
* @author Abel García de Prada
55
* @author Juan Carlos Garrote Gascón
6+
* @author Jorge Aguado Recio
67
*
7-
* Copyright (C) 2023 ownCloud GmbH.
8+
* Copyright (C) 2025 ownCloud GmbH.
89
*
910
* This program is free software: you can redistribute it and/or modify
1011
* it under the terms of the GNU General Public License version 2,
@@ -75,7 +76,7 @@ class OCRemoteAppRegistryDataSource(
7576
appProviders = appRegistryMimeTypeResponse.appProviders.map { appRegistryProviderResponse ->
7677
AppRegistryProvider(
7778
name = appRegistryProviderResponse.name,
78-
productName = appRegistryProviderResponse.productName,
79+
productName = appRegistryProviderResponse.productName ?: "",
7980
icon = appRegistryProviderResponse.icon
8081
)
8182
},

0 commit comments

Comments
 (0)