aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/plugins/com.android.ide.eclipse.adt
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2011-07-20 17:24:19 -0700
committerXavier Ducrohet <xav@android.com>2011-07-20 17:24:19 -0700
commitedaf007e1e6b512e710cd315a0504262d1ea9ddc (patch)
tree21ad30265e193c782d372bea830341da017c1913 /eclipse/plugins/com.android.ide.eclipse.adt
parentcb84ff28b21baa9e251f923fc1bb1a300729cdab (diff)
downloadsdk-edaf007e1e6b512e710cd315a0504262d1ea9ddc.zip
sdk-edaf007e1e6b512e710cd315a0504262d1ea9ddc.tar.gz
sdk-edaf007e1e6b512e710cd315a0504262d1ea9ddc.tar.bz2
Fix possible NPE in prop page if ProjectState is null.
If default.prop is not present then ProjectState is null, but the property page is required to set the target (to create the file)... Change-Id: I8bb9337476c4de1d20feca946a6f2361dc8c9af3
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.adt')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/AndroidPropertyPage.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/AndroidPropertyPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/AndroidPropertyPage.java
index 554d64d..05dede1 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/AndroidPropertyPage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/AndroidPropertyPage.java
@@ -134,13 +134,13 @@ public class AndroidPropertyPage extends PropertyPage implements IWorkbenchPrope
boolean mustSaveProp = false;
IAndroidTarget newTarget = mSelector.getSelected();
- if (newTarget != state.getTarget()) {
+ if (state == null || newTarget != state.getTarget()) {
mPropertiesWorkingCopy.setProperty(ProjectProperties.PROPERTY_TARGET,
newTarget.hashString());
mustSaveProp = true;
}
- if (mIsLibrary.getSelection() != state.isLibrary()) {
+ if (state == null || mIsLibrary.getSelection() != state.isLibrary()) {
mPropertiesWorkingCopy.setProperty(ProjectProperties.PROPERTY_LIBRARY,
Boolean.toString(mIsLibrary.getSelection()));
mustSaveProp = true;