Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-05-15 12:33:08 -0400
committerCamille Letavernier2014-05-15 12:33:08 -0400
commit942dc37aa2337b73702e9d8af935d6dd7806d88d (patch)
treeffdb3b08402e2b7993304bbafdec8d4a3f1c339f /plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties
parent4811c0fa3833e3ce8e2262e1e3b237cc33f253f8 (diff)
downloadorg.eclipse.papyrus-942dc37aa2337b73702e9d8af935d6dd7806d88d.tar.gz
org.eclipse.papyrus-942dc37aa2337b73702e9d8af935d6dd7806d88d.tar.xz
org.eclipse.papyrus-942dc37aa2337b73702e9d8af935d6dd7806d88d.zip
429642: [Model / CSS] Add properties view to define Model's stylesheets
https://bugs.eclipse.org/bugs/show_bug.cgi?id=429642 - Fix NPE when some diagrams are deleted
Diffstat (limited to 'plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties')
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSModelElement.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSModelElement.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSModelElement.java
index 8a21c29a55c..3da4640e8d4 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSModelElement.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSModelElement.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2014 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -76,6 +76,9 @@ public class CSSModelElement extends CustomStyleModelElement {
if(CSSStyles.CSS_MODEL_STYLESHEETS_KEY.equals(propertyPath)) {
//Get the resource
final Resource notationResource = source.eResource();
+ if(notationResource == null) { //May happen e.g. during deletion of the diagram
+ return null;
+ }
//Get the model styleSheet Object
Object modelStyleSheetObject = EcoreUtil.getObjectByType(notationResource.getContents(), StylesheetsPackage.Literals.MODEL_STYLE_SHEETS);
//The model styleSheet

Back to the top