summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2012-09-27 13:10:44 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-09-27 13:10:45 -0700
commitfffc9bef49428ac4974ed5c1ee2e4d0c0f9d4a5a (patch)
treeabd43301699716470464c43a6b401c0b7b7e8e9e /src
parentbfb5fa9ec37d58101febd13a334707f8f7e341f5 (diff)
parent88b0140241c646c87d356748621cef28a3105466 (diff)
downloadpackages_apps_settings-fffc9bef49428ac4974ed5c1ee2e4d0c0f9d4a5a.zip
packages_apps_settings-fffc9bef49428ac4974ed5c1ee2e4d0c0f9d4a5a.tar.gz
packages_apps_settings-fffc9bef49428ac4974ed5c1ee2e4d0c0f9d4a5a.tar.bz2
Merge "Precreate a data structure so it's never null." into jb-mr1-dev
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/vpn2/VpnSettings.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/com/android/settings/vpn2/VpnSettings.java b/src/com/android/settings/vpn2/VpnSettings.java
index de7c034..9d15435 100644
--- a/src/com/android/settings/vpn2/VpnSettings.java
+++ b/src/com/android/settings/vpn2/VpnSettings.java
@@ -73,7 +73,7 @@ public class VpnSettings extends SettingsPreferenceFragment implements
private final KeyStore mKeyStore = KeyStore.getInstance();
private boolean mUnlocking = false;
- private HashMap<String, VpnPreference> mPreferences;
+ private HashMap<String, VpnPreference> mPreferences = new HashMap<String, VpnPreference>();
private VpnDialog mDialog;
private Handler mUpdater;
@@ -173,8 +173,7 @@ public class VpnSettings extends SettingsPreferenceFragment implements
// Currently we are the only user of profiles in KeyStore.
// Assuming KeyStore and KeyGuard do the right thing, we can
// safely cache profiles in the memory.
- if (mPreferences == null) {
- mPreferences = new HashMap<String, VpnPreference>();
+ if (mPreferences.size() == 0) {
PreferenceGroup group = getPreferenceScreen();
final Context context = getActivity();