From 65b52b6fde40473ce94c1b6b03edeb2328e859f2 Mon Sep 17 00:00:00 2001
From: Alberto Debiasi <adebiasi@fbk.eu>
Date: Fri, 2 Feb 2018 09:40:19 +0100
Subject: [PATCH] small fix on PapyrusModelListener

Change-Id: I9e3afe9f5498671acaf2d045d0bf0480d6b87cdb
Signed-off-by: Alberto Debiasi <adebiasi@fbk.eu>
---
 .../chessextension/listeners/PapyrusModelListener.java       | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/plugins/contracts/org.polarsys.chess.contracts.chessextension/src/org/polarsys/chess/contracts/chessextension/listeners/PapyrusModelListener.java b/plugins/contracts/org.polarsys.chess.contracts.chessextension/src/org/polarsys/chess/contracts/chessextension/listeners/PapyrusModelListener.java
index b695bf1e6..88d3069d4 100644
--- a/plugins/contracts/org.polarsys.chess.contracts.chessextension/src/org/polarsys/chess/contracts/chessextension/listeners/PapyrusModelListener.java
+++ b/plugins/contracts/org.polarsys.chess.contracts.chessextension/src/org/polarsys/chess/contracts/chessextension/listeners/PapyrusModelListener.java
@@ -49,7 +49,10 @@ public class PapyrusModelListener implements IPapyrusListener {
 	public void notifyChanged(Notification notification) {
 		Object notifier = notification.getNotifier();
 		
-		if((notifier instanceof Class)&(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().isEditorAreaVisible())){
+		if((PlatformUI.getWorkbench().getActiveWorkbenchWindow()!=null)
+				&&(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()!=null)
+				&&(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().isEditorAreaVisible())
+				&&(notifier instanceof Class)){
 			Class cblock = (Class) notifier;
 			
 			if(notification.getEventType() == StereotypeExtensionNotification.STEREOTYPE_APPLIED_TO_ELEMENT){
-- 
GitLab