Return null trust when getting trust while not logged in.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 16 Jan 2011 13:46:03 +0000 (14:46 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 16 Jan 2011 13:46:03 +0000 (14:46 +0100)
src/main/java/net/pterodactylus/sone/template/SoneAccessor.java

index 7eaf085..beb7f2a 100644 (file)
@@ -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);