Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2015-09-02 07:52:36 +0000
committerCamille Letavernier2015-09-02 08:25:49 +0000
commitec246d249ac553f138f8b1c3c5eb605b13c023bd (patch)
treeb26bb75e3f32cccbdd86f4d77241dc276ae9b0b0 /plugins/infra/core
parentc84346b691d3ffa874618fceda8259d890ec3bf6 (diff)
downloadorg.eclipse.papyrus-ec246d249ac553f138f8b1c3c5eb605b13c023bd.tar.gz
org.eclipse.papyrus-ec246d249ac553f138f8b1c3c5eb605b13c023bd.tar.xz
org.eclipse.papyrus-ec246d249ac553f138f8b1c3c5eb605b13c023bd.zip
476371: State Machine profile cannot be applied
https://bugs.eclipse.org/bugs/show_bug.cgi?id=476371 - Partial fix: avoid NPEs for resources without URI or without File extension Change-Id: I23471d8429e8f707344aac3a8a32ee71f6776c38 Signed-off-by: Camille Letavernier <camille.letavernier@cea.fr>
Diffstat (limited to 'plugins/infra/core')
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/EMFLogicalModel.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/EMFLogicalModel.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/EMFLogicalModel.java
index 123cc50a34b..d117999cebb 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/EMFLogicalModel.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/EMFLogicalModel.java
@@ -63,11 +63,16 @@ public abstract class EMFLogicalModel extends AbstractBaseModel implements IEMFM
}
protected boolean isRelatedResource(Resource resource) {
- if (resource == null) {
+ if (resource == null || resource.getURI() == null) {
return false;
}
- return resource.getURI().fileExtension().equals(getModelFileExtension());
+ URI uri = resource.getURI();
+ if (uri.fileExtension() == null) {
+ return false;
+ }
+
+ return uri.fileExtension().equals(getModelFileExtension());
}
@Override

Back to the top