Skip to content

Commit 2714061

Browse files
committed
Add null check for downloaded image
1 parent 0aaf1f7 commit 2714061

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenDeviceIconManager.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ void retrieveIcon(String iconURL, OnIconRetrievedListener iconRetrievedListener)
5454
if (icon == null) {
5555
DebugTool.logInfo("Icon from cache was null, attempting to re-download");
5656
icon = AndroidTools.downloadImage(iconURL);
57-
saveFileToCache(icon, iconURL);
57+
if (icon != null) {
58+
saveFileToCache(icon, iconURL);
59+
} else {
60+
iconRetrievedListener.onError("Icon downloaded was null");
61+
return;
62+
}
5863
}
5964
iconRetrievedListener.onImageRetrieved(icon);
6065
} else {

0 commit comments

Comments
 (0)