aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2012-07-19 15:36:38 -0700
committerTor Norbye <tnorbye@google.com>2012-07-19 15:53:58 -0700
commit1a3094e731ceaa35c086e0e90e56f5f8e766753c (patch)
treed1ef6ba15aa15130d29bef4a6f25f5bea5e112ee /eclipse
parentacc10b6b8820f46a7b9dd1cbffb23dad46ff3990 (diff)
downloadsdk-1a3094e731ceaa35c086e0e90e56f5f8e766753c.zip
sdk-1a3094e731ceaa35c086e0e90e56f5f8e766753c.tar.gz
sdk-1a3094e731ceaa35c086e0e90e56f5f8e766753c.tar.bz2
Prevent NPE when activating layouts that have been deleted
Change-Id: I78af9a552757f3e28369d5f2de112541b1a8ea98
Diffstat (limited to 'eclipse')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationComposite.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationComposite.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationComposite.java
index 529a9a9..692d1ce 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationComposite.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationComposite.java
@@ -3139,7 +3139,7 @@ public class ConfigurationComposite extends Composite implements SelectionListen
Pair<ResourceQualifier[], IAndroidTarget> pair = loadRenderState();
// Only sync the locale if this layout is not already a locale-specific layout!
- if (!isLocaleSpecificLayout()) {
+ if (pair != null && !isLocaleSpecificLayout()) {
ResourceQualifier[] locale = pair.getFirst();
if (locale != null) {
localeChanged = setLocaleCombo(locale[0], locale[1]);
@@ -3147,7 +3147,7 @@ public class ConfigurationComposite extends Composite implements SelectionListen
}
// Sync render target
- IAndroidTarget target = pair.getSecond();
+ IAndroidTarget target = pair != null ? pair.getSecond() : getSelectedTarget();
if (target != null) {
if (getRenderingTarget() != target) {
selectTarget(target);
@@ -3202,6 +3202,10 @@ public class ConfigurationComposite extends Composite implements SelectionListen
*/
private Pair<ResourceQualifier[], IAndroidTarget> loadRenderState() {
IProject project = mEditedFile.getProject();
+ if (!project.isAccessible()) {
+ return null;
+ }
+
try {
String data = project.getPersistentProperty(NAME_RENDER_STATE);
if (data != null) {