Skip to content

Commit 64302cb

Browse files
adalpariclaude
andauthored
Fix crash when push notification icon URL has illegal characters (#23138)
A push notification icon URL that decodes to an illegal character (e.g. an unencoded space) caused ImageUtils.downloadBitmap to throw an unchecked IllegalArgumentException, crashing the entire Firebase push-message handler. Widen the catch in getLargeIconBitmap to skip the large icon instead. Fixes JETPACK-ANDROID-1BYM Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 9fb294d commit 64302cb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

WordPress/src/main/java/org/wordpress/android/push/GCMMessageHandler.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,10 @@ private Bitmap getLargeIconBitmap(Context context, String iconUrl, boolean shoul
641641
if (largeIconBitmap != null && shouldCircularizeIcon) {
642642
largeIconBitmap = ImageUtils.getCircularBitmap(largeIconBitmap);
643643
}
644-
} catch (UnsupportedEncodingException e) {
644+
} catch (UnsupportedEncodingException | IllegalArgumentException e) {
645+
// IllegalArgumentException is thrown by ImageUtils.downloadBitmap when the icon URL
646+
// contains illegal characters (e.g. an unencoded space). In that case just skip the
647+
// large icon instead of crashing the whole push notification handler.
645648
AppLog.e(T.NOTIFS, e);
646649
}
647650
}

0 commit comments

Comments
 (0)