Prevent NPE if last good version is null
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Tue, 24 Nov 2015 20:18:27 +0000 (21:18 +0100)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Tue, 24 Nov 2015 20:18:27 +0000 (21:18 +0100)
src/main/java/net/pterodactylus/fcp/AddPeer.java

index e9ad80d..f098106 100644 (file)
@@ -80,7 +80,7 @@ public class AddPeer extends FcpMessage {
         *            The noderef of the peer
         */
        private void setNodeRef(NodeRef nodeRef) {
-               setField("lastGoodVersion", nodeRef.getLastGoodVersion().toString());
+               setField("lastGoodVersion", String.valueOf(nodeRef.getLastGoodVersion()));
                setField("opennet", String.valueOf(nodeRef.isOpennet()));
                setField("identity", nodeRef.getIdentity());
                setField("myName", nodeRef.getMyName());