mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-05 19:08:23 +00:00
Fix parsing of permissions when kind is not present inside the json
This commit is contained in:
@@ -49,7 +49,7 @@ data class Permission(
|
||||
companion object {
|
||||
fun fromJson(jsonObject: JsonNode): Permission = Permission(
|
||||
type = jsonObject.get("type").asText().intern(),
|
||||
kind = jsonObject.get("kind").asText()?.toIntOrNull(),
|
||||
kind = jsonObject.get("kind")?.asText()?.toIntOrNull(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -421,7 +421,8 @@ object IntentUtils {
|
||||
val permissions: MutableList<Permission>? = json?.let {
|
||||
try {
|
||||
Permission.mapper.readValue<MutableList<Permission>>(it)
|
||||
} catch (_: Exception) {
|
||||
} catch (e: Exception) {
|
||||
AmberLog.e("IntentUtils", "Error parsing permissions: $json", e)
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user