Browse Source

Fix crash on Android OS shutdown request

Ivan Savenko 1 year ago
parent
commit
6b9d2809b1
1 changed files with 7 additions and 0 deletions
  1. 7 0
      client/Client.cpp

+ 7 - 0
client/Client.cpp

@@ -738,6 +738,13 @@ extern "C" JNIEXPORT jboolean JNICALL Java_eu_vcmi_vcmi_NativeMethods_tryToSaveT
 	logGlobal->info("Received emergency save game request");
 	if(!LOCPLINT || !LOCPLINT->cb)
 	{
+		logGlobal->info("... but no active player interface found!");
+		return false;
+	}
+
+	if (!CSH || !CSH->logicConnection)
+	{
+		logGlobal->info("... but no active connection found!");
 		return false;
 	}