Skip to content

Commit

Permalink
TEIIDDES-3108 Added null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
blafond committed Sep 28, 2017
1 parent 72107df commit 8922301
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -1812,7 +1812,14 @@ private void updateDiagramController() {
boolean useExistingController = false;

// get the new diagram's controller class (if exists)
final Class controllerClass = DiagramUiPlugin.getDiagramTypeManager().getDiagram((getDiagram()).getType()).getDiagramControllerClass();
Diagram theDiagram = getDiagram();
Class controllerClass = null;
if( theDiagram != null ) {
IDiagramType theNextDiagramType = DiagramUiPlugin.getDiagramTypeManager().getDiagram(theDiagram.getType());
if( theNextDiagramType != null ) {
controllerClass = theNextDiagramType.getDiagramControllerClass();
}
}

// Clean up and remove current controller if exists.
// Check for non-null controller and if non-null, then is it the same class as the new diagram type.
Expand Down

0 comments on commit 8922301

Please sign in to comment.