From: David ‘Bombe’ Roden Date: Fri, 31 Dec 2010 10:22:54 +0000 (+0100) Subject: Don’t try to get the status of a non-existing Sone. X-Git-Tag: beta-freefall-0.6.2-1~160 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=2080c6949a816918370c97eede6a87a3f24f7c5a;p=Sone.git Don’t try to get the status of a non-existing Sone. --- diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java index ae3dfc2..015add5 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java @@ -63,12 +63,15 @@ public class GetStatusAjaxPage extends JsonPage { protected JsonObject createJsonObject(Request request) { /* load Sones. */ boolean loadAllSones = Boolean.parseBoolean(request.getHttpRequest().getParam("loadAllSones", "true")); - Set sones = new HashSet(Collections.singleton(getCurrentSone(request.getToadletContext()))); + Set sones = new HashSet(Collections.singleton(getCurrentSone(request.getToadletContext(), false))); if (loadAllSones) { sones.addAll(webInterface.getCore().getSones()); } JsonArray jsonSones = new JsonArray(); for (Sone sone : sones) { + if (sone == null) { + continue; + } JsonObject jsonSone = createJsonSone(sone); jsonSones.add(jsonSone); }