correct keyserver preference retrieval

This commit is contained in:
Adithya Abraham Philip
2015-07-02 05:24:04 +05:30
parent 9fe05ed1e7
commit 3510275a7f
2 changed files with 6 additions and 2 deletions

View File

@@ -138,6 +138,9 @@ public class Preferences {
public String[] getKeyServers() {
String rawData = mSharedPreferences.getString(Constants.Pref.KEY_SERVERS,
Constants.Defaults.KEY_SERVERS);
if (rawData.equals("")) {
return new String[0];
}
Vector<String> servers = new Vector<>();
String chunks[] = rawData.split(",");
for (String c : chunks) {
@@ -150,7 +153,8 @@ public class Preferences {
}
public String getPreferredKeyserver() {
return getKeyServers()[0];
String[] keyservers = getKeyServers();
return keyservers.length == 0 ? null : keyservers[0];
}
public void setKeyServers(String[] value) {