Commit c8836a53 authored by Romain Bioteau's avatar Romain Bioteau

fix(diagram) npe trigged when a diagram is not closed gracefully

Closes STUDIO-3393
parent de752fe7
......@@ -14,8 +14,10 @@ import org.bonitasoft.studio.designer.ui.property.section.control.WebPageNameRes
import org.bonitasoft.studio.diagram.custom.repository.DiagramFileStore;
import org.bonitasoft.studio.diagram.custom.repository.DiagramRepositoryStore;
import org.bonitasoft.studio.model.process.diagram.part.ProcessDiagramEditor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PartInitException;
public class CustomProcessDiagramEditor extends ProcessDiagramEditor {
......@@ -49,6 +51,15 @@ public class CustomProcessDiagramEditor extends ProcessDiagramEditor {
updateWebPageChangeListener(partName);
}
}
@Override
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
if(getSite() == null || getSite().getPage() == null) {
//invalid editor
return;
}
super.selectionChanged(part, selection);
}
private void updateWebPageChangeListener(String processName) {
DiagramFileStore fileStore = RepositoryManager.getInstance()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment