aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/plugins/com.android.ide.eclipse.adt/src/com
diff options
context:
space:
mode:
authorRaphael Moll <ralf@android.com>2010-11-22 18:43:43 -0800
committerRaphael Moll <ralf@android.com>2010-11-22 20:47:15 -0800
commita19e364a559f151ca2985d348384bf0e2ef7768d (patch)
treea504877d216a53b22b17715a33a9dea8f1168cce /eclipse/plugins/com.android.ide.eclipse.adt/src/com
parent476a6e18ba87159b34fabb8a0bd73abb804c5079 (diff)
downloadsdk-a19e364a559f151ca2985d348384bf0e2ef7768d.zip
sdk-a19e364a559f151ca2985d348384bf0e2ef7768d.tar.gz
sdk-a19e364a559f151ca2985d348384bf0e2ef7768d.tar.bz2
Fix potential NPE when closing Eclipse/ADT
Seems like it was trying to finish a build and closing the plugin ADT at the same time. How's that even possible? In any case I've never seen that before and I was in debug mode, so I bet it's a rare race condition. SDK Bug 3222178 Change-Id: I28a9bdfcbe56e2a6b73eafb5cadea611c5177f7f
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.adt/src/com')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/BuildHelper.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/BuildHelper.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/BuildHelper.java
index 5047e11..088c9ef 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/BuildHelper.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/BuildHelper.java
@@ -213,8 +213,13 @@ public class BuildHelper {
throws ApkCreationException, KeytoolException, AndroidLocationException,
NativeLibInJarException, DuplicateFileException, CoreException {
+ AdtPlugin adt = AdtPlugin.getDefault();
+ if (adt == null) {
+ return;
+ }
+
// get the debug keystore to use.
- IPreferenceStore store = AdtPlugin.getDefault().getPreferenceStore();
+ IPreferenceStore store = adt.getPreferenceStore();
String keystoreOsPath = store.getString(AdtPrefs.PREFS_CUSTOM_DEBUG_KEYSTORE);
if (keystoreOsPath == null || new File(keystoreOsPath).isFile() == false) {
keystoreOsPath = DebugKeyProvider.getDefaultKeyStoreOsPath();