From 94de851aae095b18624d18518d163d353a92d56a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Ib=C3=A1=C3=B1ez=20S=C3=A1nchez?= Date: Fri, 1 Mar 2024 19:27:29 +0100 Subject: [PATCH] fix: resolve null pointer exceptions accessing missing URIs --- .../main/java/com/jacobibanez/godot/gpgs/events/EventsMapper.kt | 2 +- .../jacobibanez/godot/gpgs/leaderboards/LeaderboardMapper.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/jacobibanez/godot/gpgs/events/EventsMapper.kt b/app/src/main/java/com/jacobibanez/godot/gpgs/events/EventsMapper.kt index 2af0746..a3d2b31 100644 --- a/app/src/main/java/com/jacobibanez/godot/gpgs/events/EventsMapper.kt +++ b/app/src/main/java/com/jacobibanez/godot/gpgs/events/EventsMapper.kt @@ -10,7 +10,7 @@ fun fromEvent(godot: Godot, event: Event) = Dictionary().apply { put("description", event.description) put("eventId", event.eventId) put("formattedValue", event.formattedValue) - event.iconImageUri.let { + event.iconImageUri?.let { put( "iconImageUri", it.toStringAndSave(godot, "iconImageUri", event.eventId) diff --git a/app/src/main/java/com/jacobibanez/godot/gpgs/leaderboards/LeaderboardMapper.kt b/app/src/main/java/com/jacobibanez/godot/gpgs/leaderboards/LeaderboardMapper.kt index c00a956..83247df 100644 --- a/app/src/main/java/com/jacobibanez/godot/gpgs/leaderboards/LeaderboardMapper.kt +++ b/app/src/main/java/com/jacobibanez/godot/gpgs/leaderboards/LeaderboardMapper.kt @@ -46,7 +46,7 @@ fun fromLeaderboard(godot: Godot, leaderboard: Leaderboard) = Dictionary().apply put("displayName", leaderboard.displayName) put("variants", fromLeaderboardVariant(leaderboard.variants)) ScoreOrder.fromOrder(leaderboard.scoreOrder)?.let { put("scoreOrder", it.name) } - leaderboard.iconImageUri.let { + leaderboard.iconImageUri?.let { put( "iconImageUri", it.toStringAndSave(