From: David ‘Bombe’ Roden Date: Fri, 23 Sep 2011 19:04:34 +0000 (+0200) Subject: If notification does not exist, don’t try to filter it. X-Git-Tag: 0.7^2~2^2~15 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=d523d86314fd46d18f3d72cf088694e272deffab;p=Sone.git If notification does not exist, don’t try to filter it. --- diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetNotificationAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetNotificationAjaxPage.java index 198a04f..dfac8e4 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetNotificationAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetNotificationAjaxPage.java @@ -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) notification, currentSone, false); } else if ("new-reply-notification".equals(notificationId)) {