]> nmode's Git Repositories - signal-cli/commitdiff
Fix NPE when not specifying receive timeout
authorAsamK <asamk@gmx.de>
Wed, 25 Nov 2015 13:38:30 +0000 (14:38 +0100)
committerAsamK <asamk@gmx.de>
Wed, 25 Nov 2015 13:39:33 +0000 (14:39 +0100)
src/main/java/cli/Main.java

index 44a89505bd03a31fe3cbf21ac121179af6585a5b..728ea35bf03aa0d4fc011e9a57b66ade6edd6fe2 100644 (file)
@@ -141,7 +141,10 @@ public class Main {
                     System.err.println("User is not registered.");
                     System.exit(1);
                 }
                     System.err.println("User is not registered.");
                     System.exit(1);
                 }
-                int timeout = ns.getInt("timeout");
+                int timeout = 5;
+                if (ns.getInt("timeout") != null) {
+                    timeout = ns.getInt("timeout");
+                }
                 boolean returnOnTimeout = true;
                 if (timeout < 0) {
                     returnOnTimeout = false;
                 boolean returnOnTimeout = true;
                 if (timeout < 0) {
                     returnOnTimeout = false;