Update notification fragment logging to simplify null checks
This commit is contained in:
parent
40ae45e126
commit
c62b523152
|
@ -506,21 +506,12 @@ public class NotificationsFragment extends SFragment implements
|
||||||
|
|
||||||
NotificationViewData notification = notifications.getPairedItem(position);
|
NotificationViewData notification = notifications.getPairedItem(position);
|
||||||
if(!(notification instanceof NotificationViewData.Concrete)) {
|
if(!(notification instanceof NotificationViewData.Concrete)) {
|
||||||
if(notification == null) {
|
|
||||||
Log.e(TAG, String.format(
|
|
||||||
"Tried to access notification but got null at position: %d of %d",
|
|
||||||
position,
|
|
||||||
notifications.size() - 1)
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
Log.e(TAG, String.format(
|
Log.e(TAG, String.format(
|
||||||
"Expected NotificationViewData.Concrete, got %s instead at position: %d of %d",
|
"Expected NotificationViewData.Concrete, got %s instead at position: %d of %d",
|
||||||
notification.getClass().getSimpleName(),
|
notification == null ? "null" : notification.getClass().getSimpleName(),
|
||||||
position,
|
position,
|
||||||
notifications.size() - 1
|
notifications.size() - 1
|
||||||
));
|
));
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue