diff options
author | Raphael Moll <ralf@android.com> | 2012-04-27 10:22:39 -0700 |
---|---|---|
committer | android code review <noreply-gerritcodereview@google.com> | 2012-04-27 10:22:39 -0700 |
commit | f62902ac1a6d5641c836ea47066a599cd88ce129 (patch) | |
tree | 155f82e2c6e69ffc1e6263f48e25f4bf2db1b898 /eclipse | |
parent | e97dacc242c7c89b65552ee813b93faad427193a (diff) | |
parent | 297d439f24c22519ec88c88360c2549f20426d6d (diff) | |
download | sdk-f62902ac1a6d5641c836ea47066a599cd88ce129.zip sdk-f62902ac1a6d5641c836ea47066a599cd88ce129.tar.gz sdk-f62902ac1a6d5641c836ea47066a599cd88ce129.tar.bz2 |
Merge "ADT: Fix NPE when converting legacy default.properties"
Diffstat (limited to 'eclipse')
2 files changed, 7 insertions, 1 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 584d49f..212263a 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 @@ -143,7 +143,9 @@ public class AndroidPropertyPage extends PropertyPage { mPropertiesWorkingCopy.save(); IResource projectProp = mProject.findMember(SdkConstants.FN_PROJECT_PROPERTIES); - projectProp.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor()); + if (projectProp != null) { + projectProp.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor()); + } } catch (Exception e) { String msg = String.format( "Failed to save %1$s for project %2$s", diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java index 2a1fba9..4f9bb09 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java @@ -442,6 +442,10 @@ public final class Sdk { // delete the old file. ProjectProperties.delete(projectLocation, PropertyType.LEGACY_DEFAULT); + + // make sure to use the new properties + properties = ProjectProperties.load(projectLocation, + PropertyType.PROJECT); } catch (Exception e) { AdtPlugin.log(IStatus.ERROR, "Failed to rename properties file to %1$s for project '%s2$'", |