From 181af5c8af499a60095f46748d6f0a40c40f88db Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 19 Oct 2010 16:39:43 +0200 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20crash=20when=20not=20logged=20in?= =?utf8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/template/SoneAccessor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java b/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java index ebf2f82..60e2e9b 100644 --- a/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java +++ b/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java @@ -67,13 +67,13 @@ public class SoneAccessor extends ReflectionAccessor { return getNiceName(sone); } else if (member.equals("friend")) { Sone currentSone = (Sone) dataProvider.getData("currentSone"); - return currentSone.hasFriend(sone) ? true : null; + return (currentSone != null) && currentSone.hasFriend(sone); } else if (member.equals("current")) { Sone currentSone = (Sone) dataProvider.getData("currentSone"); - return currentSone.equals(sone); + return (currentSone != null) && currentSone.equals(sone); } else if (member.equals("blocked")) { Sone currentSone = (Sone) dataProvider.getData("currentSone"); - return currentSone.isSoneBlocked(sone.getId()); + return (currentSone != null) && currentSone.isSoneBlocked(sone.getId()); } else if (member.equals("modified")) { return sone.getModificationCounter() > 0; } else if (member.equals("status")) { -- 2.7.4