Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormvelten2012-04-10 08:21:02 +0000
committermvelten2012-04-10 08:21:02 +0000
commit689bdcbe6866e93d84cf0fc03da35ffe8e9cfb14 (patch)
tree784ae46a54810e3e6004cbd1d652ce8aa6306208
parent5f93b01834d0dc5443632a6c030e3def6dff6fa0 (diff)
downloadorg.eclipse.papyrus-689bdcbe6866e93d84cf0fc03da35ffe8e9cfb14.tar.gz
org.eclipse.papyrus-689bdcbe6866e93d84cf0fc03da35ffe8e9cfb14.tar.xz
org.eclipse.papyrus-689bdcbe6866e93d84cf0fc03da35ffe8e9cfb14.zip
fix NPE
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/CreateAllocationTableCommand.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/CreateAllocationTableCommand.java b/plugins/sysml/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/CreateAllocationTableCommand.java
index 7dcac8210af..178be0f7d11 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/CreateAllocationTableCommand.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/CreateAllocationTableCommand.java
@@ -78,7 +78,9 @@ public class CreateAllocationTableCommand extends AbstractCreateNattableEditorCo
Element el = (Element)object;
Package pack = el.getNearestPackage();
//we can create an Allocation Table only when the profile is applied
- return pack.getAppliedProfile(SysmlResource.ALLOCATIONS_ID, true) != null;
+ if (pack != null) {
+ return pack.getAppliedProfile(SysmlResource.ALLOCATIONS_ID, true) != null;
+ }
}
return false;
}

Back to the top