summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Wouters2014-03-25 03:49:58 (EDT)
committerLaurent Wouters2014-03-25 10:16:44 (EDT)
commitbd06e7715877e2dee9c8bbe0a7c7af6a927a3985 (patch)
tree61bb3b5c3bb717927b1c1629f2714b69ed50d9ce
parent643e96d03721c93efb1a708b3198cf4eafb5bdc9 (diff)
downloadorg.eclipse.papyrus-bd06e7715877e2dee9c8bbe0a7c7af6a927a3985.zip
org.eclipse.papyrus-bd06e7715877e2dee9c8bbe0a7c7af6a927a3985.tar.gz
org.eclipse.papyrus-bd06e7715877e2dee9c8bbe0a7c7af6a927a3985.tar.bz2
#430703: [Model Explorer] NPE throw when an invalid diagram is added to the model
Fixed NPE on Linux with more checks https://bugs.eclipse.org/bugs/show_bug.cgi?id=430703 Signed-off-by: Laurent Wouters <laurent.wouters@cea.fr>
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/custom-src/org/eclipse/papyrus/infra/viewpoints/configuration/ui/ModelElementSelectionDialog.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/custom-src/org/eclipse/papyrus/infra/viewpoints/configuration/ui/ModelElementSelectionDialog.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/custom-src/org/eclipse/papyrus/infra/viewpoints/configuration/ui/ModelElementSelectionDialog.java
index 3020ec1..85e407c 100755
--- a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/custom-src/org/eclipse/papyrus/infra/viewpoints/configuration/ui/ModelElementSelectionDialog.java
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration/custom-src/org/eclipse/papyrus/infra/viewpoints/configuration/ui/ModelElementSelectionDialog.java
@@ -205,9 +205,15 @@ public class ModelElementSelectionDialog extends Dialog {
protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setSize(SIZE_WIDTH, SIZE_HEIGHT);
- Point size = shell.getParent().getShell().getSize();
- shell.setLocation((size.x - SIZE_WIDTH)/2, (size.y - SIZE_HEIGHT)/2);
shell.setText(MSG_TITLE);
+ if (shell.getParent() != null) {
+ Composite parent = shell.getParent();
+ Shell parentShell = parent.getShell();
+ if (parentShell != null) {
+ Point size = parentShell.getSize();
+ shell.setLocation((size.x - SIZE_WIDTH) / 2, (size.y - SIZE_HEIGHT) / 2);
+ }
+ }
}
private ILabelProvider getLabelProvider() {