diff options
| author | Maxime Porhel | 2015-08-05 07:13:31 +0000 |
|---|---|---|
| committer | Maxime Porhel | 2015-08-05 07:42:05 +0000 |
| commit | 3092d13542f7a067253168b243ccde11d7fffb18 (patch) | |
| tree | 9a751f67b048a783f0cd2dd2999d2323f340bad2 | |
| parent | afe9f8bd54d7c6563389597d1c05fa9e4c2a51e2 (diff) | |
| download | org.eclipse.sirius-3092d13542f7a067253168b243ccde11d7fffb18.tar.gz org.eclipse.sirius-3092d13542f7a067253168b243ccde11d7fffb18.tar.xz org.eclipse.sirius-3092d13542f7a067253168b243ccde11d7fffb18.zip | |
[464269] Avoid NPE in SelectDRepresentationElementsistener init
In some cases like GotoMarker, an editor might be opened with a null
representation.
Bug: 464269
Change-Id: Ia7c022b336eb9c79acbb213cf16d53b3d065b196
Signed-off-by: Maxime Porhel <maxime.porhel@obeo.fr>
| -rw-r--r-- | plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/editor/SelectDRepresentationElementsListener.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/editor/SelectDRepresentationElementsListener.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/editor/SelectDRepresentationElementsListener.java index 459c4fb1e7..c4575d1a69 100644 --- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/editor/SelectDRepresentationElementsListener.java +++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/editor/SelectDRepresentationElementsListener.java @@ -106,9 +106,12 @@ public class SelectDRepresentationElementsListener extends ResourceSetListenerIm private void init(DialectEditor editor, boolean defaultSelection) { dialectEditor = Preconditions.checkNotNull(editor); this.activateDefaultSelection = defaultSelection; - TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(editor.getRepresentation()); - if (domain != null) { - domain.addResourceSetListener(this); + DRepresentation representation = editor.getRepresentation(); + if (representation != null) { + TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(representation); + if (domain != null) { + domain.addResourceSetListener(this); + } } } |
