project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/netplay/Netplay.java
branchhedgeroid
changeset 15511 fb23e49b2d4e
parent 10017 de822cd3df3a
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/netplay/Netplay.java	Fri Dec 06 22:20:53 2019 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/netplay/Netplay.java	Sat Dec 07 16:14:27 2019 +0100
@@ -188,6 +188,10 @@
 
     private static Netplay instance;
 
+    public static boolean hasAppInstance() {
+        return instance != null;
+    }
+
     /**
      * Retrieve the single app-wide instance of the netplay interface, creating it if it
      * does not exist yet.
@@ -196,7 +200,7 @@
      * @return
      */
     public static Netplay getAppInstance(Context applicationContext) {
-        if(instance == null) {
+        if (!hasAppInstance()) {
             // We will need some default values for rooms, best load them here
             Scheme defaultScheme = null;
             Weaponset defaultWeaponset = null;