If notification does not exist, don’t try to filter it.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ajax / GetNotificationAjaxPage.java
index 198a04f..dfac8e4 100644 (file)
@@ -82,6 +82,10 @@ public class GetNotificationAjaxPage extends JsonPage {
                Sone currentSone = getCurrentSone(request.getToadletContext(), false);
                for (String notificationId : notificationIds) {
                        Notification notification = webInterface.getNotifications().getNotification(notificationId);
+                       if (notification == null) {
+                               // TODO - show error
+                               continue;
+                       }
                        if ("new-post-notification".equals(notificationId)) {
                                notification = ListNotificationFilters.filterNewPostNotification((ListNotification<Post>) notification, currentSone, false);
                        } else if ("new-reply-notification".equals(notificationId)) {