From 457019ac679bb555239c4749da197205857d9f9f Mon Sep 17 00:00:00 2001 From: Vlad Dumitrescu Date: Fri, 12 Sep 2014 12:16:45 +0200 Subject: handle empty .erlang.cookie without crashing --- lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractNode.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/jinterface') 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 { -- cgit v1.2.3 From b64eb80453cdaac936eba1e46f814f4e8b92f65b Mon Sep 17 00:00:00 2001 From: Vlad Dumitrescu Date: Fri, 12 Sep 2014 12:23:00 +0200 Subject: OtpErlangList.clone must not return null --- lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangList.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/jinterface') diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangList.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangList.java index 3456fd7412..e363fdb457 100644 --- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangList.java +++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangList.java @@ -326,7 +326,7 @@ public class OtpErlangList extends OtpErlangObject implements try { return new OtpErlangList(elements(), getLastTail()); } catch (final OtpErlangException e) { - return null; + throw new AssertionError(this); } } -- cgit v1.2.3