From ba407dcdae3969259237e754611af9cf444337a4 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Fri, 8 Mar 2019 15:11:06 +0400 Subject: [PATCH] Fixed NPE error on connection problem; --- Mage.Common/src/main/java/mage/remote/SessionImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Mage.Common/src/main/java/mage/remote/SessionImpl.java b/Mage.Common/src/main/java/mage/remote/SessionImpl.java index 8c1e3a05707..bd88ebdee5e 100644 --- a/Mage.Common/src/main/java/mage/remote/SessionImpl.java +++ b/Mage.Common/src/main/java/mage/remote/SessionImpl.java @@ -98,10 +98,12 @@ public class SessionImpl implements Session { if (cause instanceof InvocationFailureException) { InvocationFailureException exep = (InvocationFailureException) cause; if (exep.getCause() instanceof IOException) { - if (exep.getCause().getMessage().startsWith("Field hash null is not available on current") - || exep.getCause().getMessage().endsWith("end of file")) { + if ((exep.getCause().getMessage() != null) && (exep.getCause().getMessage().startsWith("Field hash null is not available on current") + || exep.getCause().getMessage().endsWith("end of file"))) { addMessage = "Probably the server version is not compatible with the client. "; } + } else { + logger.error("Unknown server error", exep.getCause()); } } else if (cause instanceof NoSuchMethodException) { // NoSuchMethodException is thrown on an invocation of an unknow JBoss remoting