提交 5c8699c6 编写于 作者: S Serge Rider

#9726 NPE fix. Node state save


Former-commit-id: f0399c34
上级 c028e93f
......@@ -56,6 +56,11 @@ public class DBNResource extends DBNNode// implements IContributorResourceAdapte
this.handler = handler;
}
@Override
public boolean isDisposed() {
return resource == null || super.isDisposed();
}
@Override
protected void dispose(boolean reflect)
{
......@@ -247,7 +252,12 @@ public class DBNResource extends DBNNode// implements IContributorResourceAdapte
if (pathName.length() > 0) {
pathName.insert(0, '/');
}
pathName.insert(0, ((DBNResource) node).getResource().getName());
IResource resource = ((DBNResource) node).getResource();
if (resource != null) {
pathName.insert(0, resource.getName());
} else{
pathName.insert(0, "?");
}
}
return NodePathType.resource.getPrefix() + pathName.toString();
}
......
......@@ -64,6 +64,9 @@ public class NodeEditorInputFactory implements IElementFactory
public static void saveState(IMemento memento, NodeEditorInput input)
{
final DBNNode node = input.getNavigatorNode();
if (node.isDisposed()) {
return;
}
memento.putString(TAG_NODE, node.getNodeItemPath());
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册