Skip to content

Commit 31d8f17

Browse files
PururunRawa
authored andcommitted
Handle out of memory exception when parsing app icon as bitmap
1 parent 704fa0b commit 31d8f17

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

android/app/src/main/kotlin/net/mullvad/mullvadvpn/util/PackageManagerExtensions.kt

+3
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ fun PackageManager.getApplicationIconBitmapOrNull(packageName: String): Bitmap?
1313
} catch (e: IllegalArgumentException) {
1414
// IllegalArgumentException is thrown if the application has an invalid icon
1515
null
16+
} catch (e: OutOfMemoryError) {
17+
// OutOfMemoryError is thrown if the icon is too large
18+
null
1619
}

0 commit comments

Comments
 (0)