Merge "Fix possible NPE in StorageNotification."

This commit is contained in:
Jimmy Hu
2022-11-11 04:56:20 +00:00
committed by Android (Google) Code Review

View File

@@ -381,7 +381,7 @@ public class StorageNotification implements CoreStartable {
// Don't annoy when user dismissed in past. (But make sure the disk is adoptable; we
// used to allow snoozing non-adoptable disks too.)
if (rec.isSnoozed() && disk.isAdoptable()) {
if (rec == null || (rec.isSnoozed() && disk.isAdoptable())) {
return null;
}
if (disk.isAdoptable() && !rec.isInited() && rec.getType() != VolumeInfo.TYPE_PUBLIC