aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse
diff options
context:
space:
mode:
authorRaphael <raphael@google.com>2010-03-17 15:41:07 -0700
committerRaphael <raphael@google.com>2010-03-17 15:41:07 -0700
commit5d80a3ac4a1b9035a87e41ffb65ff7abcfd57c73 (patch)
treebb2f2ac8b267a6e9188b403e45949110ea5634c6 /eclipse
parent863cb45615a0e5eced094ab2500362bf2c0ef7f2 (diff)
downloadsdk-5d80a3ac4a1b9035a87e41ffb65ff7abcfd57c73.zip
sdk-5d80a3ac4a1b9035a87e41ffb65ff7abcfd57c73.tar.gz
sdk-5d80a3ac4a1b9035a87e41ffb65ff7abcfd57c73.tar.bz2
ADT: Fix minor NPE in UI Node/descriptors when no SDK is loaded yet.
Change-Id: I075cc7cce0b9814c2f71a1b61cff117b80d7457b
Diffstat (limited to 'eclipse')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/uimodel/UiViewElementNode.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/uimodel/UiViewElementNode.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/uimodel/UiViewElementNode.java
index 0d3f339..4af0233 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/uimodel/UiViewElementNode.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/uimodel/UiViewElementNode.java
@@ -71,13 +71,15 @@ public class UiViewElementNode extends UiElementNode {
IProject project = getEditor().getProject();
if (project != null) {
Sdk currentSdk = Sdk.getCurrent();
- IAndroidTarget target = currentSdk.getTarget(project);
- if (target != null) {
- AndroidTargetData data = currentSdk.getTargetData(target);
- layoutDescriptors = data.getLayoutDescriptors().getLayoutDescriptors();
+ if (currentSdk != null) {
+ IAndroidTarget target = currentSdk.getTarget(project);
+ if (target != null) {
+ AndroidTargetData data = currentSdk.getTargetData(target);
+ layoutDescriptors = data.getLayoutDescriptors().getLayoutDescriptors();
+ }
}
}
-
+
if (layoutDescriptors != null) {
for (ElementDescriptor desc : layoutDescriptors) {
if (desc instanceof ViewElementDescriptor &&
@@ -116,7 +118,7 @@ public class UiViewElementNode extends UiElementNode {
return mCachedAttributeDescriptors;
}
-
+
/**
* Sets the parent of this UI node.
* <p/>