Return null when the insert URI is null, don’t NPE.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 4 Nov 2010 21:44:23 +0000 (22:44 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 4 Nov 2010 21:44:23 +0000 (22:44 +0100)
src/main/java/net/pterodactylus/sone/data/Sone.java

index 0afbf3b..430973c 100644 (file)
@@ -193,7 +193,7 @@ public class Sone {
         * @return The insert URI of this Sone
         */
        public FreenetURI getInsertUri() {
-               return insertUri.setSuggestedEdition(latestEdition);
+               return (insertUri != null) ? insertUri.setSuggestedEdition(latestEdition) : null;
        }
 
        /**