Fix some FindBugs warnings.
[Sone.git] / src / main / java / net / pterodactylus / sone / data / Sone.java
index 6bee1c1..0415ecd 100644 (file)
@@ -54,7 +54,7 @@ import com.google.common.primitives.Ints;
  *
  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
  */
-public class Sone implements Fingerprintable, Comparable<Sone> {
+public class Sone implements Identified, Fingerprintable, Comparable<Sone> {
 
        /**
         * Enumeration for the possible states of a {@link Sone}.
@@ -155,7 +155,7 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
 
                @Override
                public boolean apply(Sone sone) {
-                       return sone.getTime() != 0;
+                       return (sone == null) ? false : sone.getTime() != 0;
                }
        };
 
@@ -164,7 +164,7 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
 
                @Override
                public boolean apply(Sone sone) {
-                       return sone.getIdentity() instanceof OwnIdentity;
+                       return (sone == null) ? false : sone.getIdentity() instanceof OwnIdentity;
                }
 
        };
@@ -174,7 +174,7 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
 
                @Override
                public boolean apply(Sone sone) {
-                       return !sone.getRootAlbum().getAlbums().isEmpty();
+                       return (sone == null) ? false : !sone.getRootAlbum().getAlbums().isEmpty();
                }
        };