Prevent NPEs when accessing an unset time.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 14 Oct 2010 13:43:21 +0000 (15:43 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 14 Oct 2010 13:43:21 +0000 (15:43 +0200)
src/main/java/net/pterodactylus/sone/data/PostShell.java
src/main/java/net/pterodactylus/sone/data/ReplyShell.java

index af9598e..716aab9 100644 (file)
@@ -128,7 +128,7 @@ public class PostShell extends Post implements Shell<Post> {
         */
        @Override
        public long getTime() {
-               return time;
+               return (time != null) ? time : 0;
        }
 
        /**
index 355ef67..3886e63 100644 (file)
@@ -147,7 +147,7 @@ public class ReplyShell extends Reply implements Shell<Reply> {
         */
        @Override
        public long getTime() {
-               return time;
+               return (time != null) ? time : 0;
        }
 
        /**