project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/MainActivity.java
branchhedgeroid
changeset 15533 fb23e49b2d4e
parent 10017 de822cd3df3a
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/MainActivity.java	Fri Dec 06 22:20:53 2019 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/MainActivity.java	Sat Dec 07 16:14:27 2019 +0100
@@ -103,10 +103,14 @@
         broadcastManager.unregisterReceiver(connectedReceiver);
         broadcastManager.unregisterReceiver(connectionFailedReceiver);
         broadcastManager.unregisterReceiver(passwordRequestedReceiver);
-        Netplay netplay = Netplay.getAppInstance(getApplicationContext());
-        if(netplay.getState() == State.CONNECTING) {
-            netplay.disconnect();
+        // disable netplay for now
+        if (Netplay.hasAppInstance()) {
+            Netplay netplay = Netplay.getAppInstance(getApplicationContext());
+            if(netplay.getState() == State.CONNECTING) {
+                netplay.disconnect();
+            }
         }
+
     }
 
     @Override