From 415b8c3b295775d66fb1db1d0f641e05fbbcca98 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 16 Jan 2011 14:46:03 +0100 Subject: [PATCH] Return null trust when getting trust while not logged in. --- src/main/java/net/pterodactylus/sone/template/SoneAccessor.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java b/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java index 7eaf085..beb7f2a 100644 --- a/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java +++ b/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java @@ -92,6 +92,9 @@ public class SoneAccessor extends ReflectionAccessor { return core.isLocked(sone); } else if (member.equals("trust")) { Sone currentSone = (Sone) dataProvider.get("currentSone"); + if (currentSone == null) { + return null; + } Trust trust = core.getTrust(currentSone, sone); if (trust == null) { return new Trust(null, null, null); -- 2.7.4