aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2016-06-23 17:49:03 -0700
committerScott Jackson <daneren2005@gmail.com>2016-06-23 17:49:03 -0700
commit49f80c4810e3388bbaba13d9382cd8c6971bdd75 (patch)
treeee8c1cffb8ccb9dc3693ef246043c97f59c0e2b5 /app
parent031417c0b9fec1e177ce8e8d2304a4c094e635f4 (diff)
downloaddsub-49f80c4810e3388bbaba13d9382cd8c6971bdd75.tar.gz
dsub-49f80c4810e3388bbaba13d9382cd8c6971bdd75.tar.bz2
dsub-49f80c4810e3388bbaba13d9382cd8c6971bdd75.zip
Require SSID entry before using local network address
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/util/Util.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/util/Util.java b/app/src/main/java/github/daneren2005/dsub/util/Util.java
index 417c3173..9f742ef0 100644
--- a/app/src/main/java/github/daneren2005/dsub/util/Util.java
+++ b/app/src/main/java/github/daneren2005/dsub/util/Util.java
@@ -412,13 +412,15 @@ public final class Util {
String serverUrl = prefs.getString(Constants.PREFERENCES_KEY_SERVER_URL + instance, null);
if(allowAltAddress && Util.isWifiConnected(context)) {
String SSID = prefs.getString(Constants.PREFERENCES_KEY_SERVER_LOCAL_NETWORK_SSID + instance, "");
- String currentSSID = Util.getSSID(context);
-
- String[] ssidParts = SSID.split(",");
- if("".equals(SSID) || SSID.equals(currentSSID) || Arrays.asList(ssidParts).contains(currentSSID)) {
- String internalUrl = prefs.getString(Constants.PREFERENCES_KEY_SERVER_INTERNAL_URL + instance, null);
- if(internalUrl != null && !"".equals(internalUrl) && !"http://".equals(internalUrl)) {
- serverUrl = internalUrl;
+ if(!SSID.isEmpty()) {
+ String currentSSID = Util.getSSID(context);
+
+ String[] ssidParts = SSID.split(",");
+ if ("".equals(SSID) || SSID.equals(currentSSID) || Arrays.asList(ssidParts).contains(currentSSID)) {
+ String internalUrl = prefs.getString(Constants.PREFERENCES_KEY_SERVER_INTERNAL_URL + instance, null);
+ if (internalUrl != null && !"".equals(internalUrl) && !"http://".equals(internalUrl)) {
+ serverUrl = internalUrl;
+ }
}
}
}