diff options
author | Vlad Dumitrescu <[email protected]> | 2014-09-12 12:16:45 +0200 |
---|---|---|
committer | Vlad Dumitrescu <[email protected]> | 2014-09-12 12:16:45 +0200 |
commit | 457019ac679bb555239c4749da197205857d9f9f (patch) | |
tree | 10ff8965ffb955251b0e7f8499e3c882a4fa8779 | |
parent | 6e2fd45bad619fd7e06f21798eac94d415dff64e (diff) | |
download | otp-457019ac679bb555239c4749da197205857d9f9f.tar.gz otp-457019ac679bb555239c4749da197205857d9f9f.tar.bz2 otp-457019ac679bb555239c4749da197205857d9f9f.zip |
handle empty .erlang.cookie without crashing
-rw-r--r-- | lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractNode.java | 7 |
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 { |