Merge "Fix null handling"

This commit is contained in:
TreeHugger Robot
2021-01-19 21:14:40 +00:00
committed by Android (Google) Code Review

View File

@@ -595,12 +595,13 @@ public class NotificationBackend {
} }
public NotificationListenerFilter getListenerFilter(ComponentName cn, int userId) { public NotificationListenerFilter getListenerFilter(ComponentName cn, int userId) {
NotificationListenerFilter nlf = null;
try { try {
return sINM.getListenerFilter(cn, userId); nlf = sINM.getListenerFilter(cn, userId);
} catch (Exception e) { } catch (Exception e) {
Log.w(TAG, "Error calling NoMan", e); Log.w(TAG, "Error calling NoMan", e);
} }
return new NotificationListenerFilter(); return nlf != null ? nlf : new NotificationListenerFilter();
} }
public void setListenerFilter(ComponentName cn, int userId, NotificationListenerFilter nlf) { public void setListenerFilter(ComponentName cn, int userId, NotificationListenerFilter nlf) {