aboutsummaryrefslogtreecommitdiffstats
path: root/lib/jinterface
diff options
context:
space:
mode:
authorVlad Dumitrescu <[email protected]>2014-09-12 12:16:45 +0200
committerVlad Dumitrescu <[email protected]>2014-09-12 12:16:45 +0200
commit457019ac679bb555239c4749da197205857d9f9f (patch)
tree10ff8965ffb955251b0e7f8499e3c882a4fa8779 /lib/jinterface
parent6e2fd45bad619fd7e06f21798eac94d415dff64e (diff)
downloadotp-457019ac679bb555239c4749da197205857d9f9f.tar.gz
otp-457019ac679bb555239c4749da197205857d9f9f.tar.bz2
otp-457019ac679bb555239c4749da197205857d9f9f.zip
handle empty .erlang.cookie without crashing
Diffstat (limited to 'lib/jinterface')
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractNode.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractNode.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractNode.java
index 3ef44b8851..3c15978b52 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractNode.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractNode.java
@@ -128,7 +128,12 @@ public class AbstractNode {
final File dotCookieFile = new File(dotCookieFilename);
br = new BufferedReader(new FileReader(dotCookieFile));
- defaultCookie = br.readLine().trim();
+ final String line = br.readLine();
+ if (line == null) {
+ defaultCookie = "";
+ } else {
+ defaultCookie = line.trim();
+ }
} catch (final IOException e) {
defaultCookie = "";
} finally {