### Eclipse Workspace Patch 1.0 #P hippo-ecm-addon-cms-edit Index: src/main/java/org/hippoecm/frontend/plugins/cms/edit/EditorManagerPlugin.java =================================================================== --- src/main/java/org/hippoecm/frontend/plugins/cms/edit/EditorManagerPlugin.java (revision 18034) +++ src/main/java/org/hippoecm/frontend/plugins/cms/edit/EditorManagerPlugin.java (working copy) @@ -429,38 +429,39 @@ if (model != null && !active) { active = true; - JcrNodeModel parentModel = editor.getHandle(); - if (parentModel.getItemModel().exists()) { - try { - Node parent = parentModel.getNode(); - if (parent.isNodeType(HippoNodeType.NT_HANDLE)) { - // Deselect the currently selected node if it corresponds - // to the editor that is being closed. - JcrNodeModel selectedNodeModel = (JcrNodeModel) modelReference.getModel(); - if (selectedNodeModel != null) { - Node selected = selectedNodeModel.getNode(); - if (selected != null && selected instanceof HippoNode) { - try { - Node canonical = ((HippoNode) selected).getCanonicalNode(); - if (canonical != null) { - if (canonical.isSame(selected) || canonical.getParent().isSame(parent)) { - modelReference.setModel(null); + if(editor.getHandle()!=null) { + JcrNodeModel parentModel = editor.getHandle(); + if (parentModel.getItemModel().exists()) { + try { + Node parent = parentModel.getNode(); + if (parent.isNodeType(HippoNodeType.NT_HANDLE)) { + // Deselect the currently selected node if it corresponds + // to the editor that is being closed. + JcrNodeModel selectedNodeModel = (JcrNodeModel) modelReference.getModel(); + if (selectedNodeModel != null) { + Node selected = selectedNodeModel.getNode(); + if (selected != null && selected instanceof HippoNode) { + try { + Node canonical = ((HippoNode) selected).getCanonicalNode(); + if (canonical != null) { + if (canonical.isSame(selected) || canonical.getParent().isSame(parent)) { + modelReference.setModel(null); + } } + } catch (ItemNotFoundException ex) { + // physical item no longer exists } - } catch (ItemNotFoundException ex) { - // physical item no longer exists } } } + } catch (RepositoryException ex) { + log.error(ex.getMessage()); } - } catch (RepositoryException ex) { - log.error(ex.getMessage()); } + // cleanup lru list + lastReferences.remove(parentModel); } - // cleanup lru list - lastReferences.remove(parentModel); - // cleanup internals if (editors.containsKey(model)) { editors.remove(model);