If DataLength can not be parsed, assume a length of 0
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Sun, 1 Oct 2017 15:06:48 +0000 (17:06 +0200)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Sun, 1 Oct 2017 15:06:48 +0000 (17:06 +0200)
src/main/java/net/pterodactylus/fcp/FcpConnection.java

index fbc2c13..3331bdf 100644 (file)
@@ -290,7 +290,7 @@ public class FcpConnection implements Closeable {
                } else if ("UnknownNodeIdentifier".equals(messageName)) {
                        fcpListenerManager.fireReceivedUnknownNodeIdentifier(new UnknownNodeIdentifier(fcpMessage));
                } else if ("FCPPluginReply".equals(messageName)) {
-                       InputStream payloadInputStream = getInputStream(FcpUtils.safeParseLong(fcpMessage.getField("DataLength")));
+                       InputStream payloadInputStream = getInputStream(FcpUtils.safeParseLong(fcpMessage.getField("DataLength"), 0));
                        fcpListenerManager.fireReceivedFCPPluginReply(new FCPPluginReply(fcpMessage, payloadInputStream));
                } else if ("PluginInfo".equals(messageName)) {
                        fcpListenerManager.fireReceivedPluginInfo(new PluginInfo(fcpMessage));