Skip to content

Commit 92d01bf

Browse files
committed
Add null check
1 parent 0259aba commit 92d01bf

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ void retrieveIcon(String iconURL, OnIconRetrievedListener iconRetrievedListener)
7171
} catch (IOException e) {
7272
iconRetrievedListener.onError("device Icon Error Downloading, Will attempt to grab cached Icon even if expired: \n" + e.toString());
7373
icon = getFileFromCache(iconURL);
74-
iconRetrievedListener.onImageRetrieved(icon);
74+
if (icon != null) {
75+
iconRetrievedListener.onImageRetrieved(icon);
76+
} else {
77+
iconRetrievedListener.onError("Unable to retrieve icon from cache");
78+
}
7579
}
7680
}
7781

0 commit comments

Comments
 (0)