Skip to content

Commit 0c42465

Browse files
fix(notifications): Catch Exception when download icon image of pinpoint notification (#2873)
Co-authored-by: Matt Creaser <mattwcc@amazon.com>
1 parent cfe0de0 commit 0c42465

File tree

1 file changed

+3
-1
lines changed
  • aws-push-notifications-pinpoint-common/src/main/java/com/amplifyframework/pushnotifications/pinpoint

1 file changed

+3
-1
lines changed

aws-push-notifications-pinpoint-common/src/main/java/com/amplifyframework/pushnotifications/pinpoint/PushNotificationsUtils.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ class PushNotificationsUtils(
7777
}
7878

7979
private suspend fun downloadImage(url: String): Bitmap? = withContext(Dispatchers.IO) {
80-
BitmapFactory.decodeStream(URL(url).openConnection().getInputStream())
80+
runCatching {
81+
BitmapFactory.decodeStream(URL(url).openConnection().getInputStream())
82+
}.getOrNull()
8183
}
8284

8385
fun isAppInForeground(): Boolean {

0 commit comments

Comments
 (0)