Try to fix NullPointerException in NodeProxy.getNode().
This commit is contained in:
parent
4875a85fce
commit
b0478b020b
1 changed files with 15 additions and 12 deletions
|
@ -1148,6 +1148,7 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
|||
if (node == null || node.getState() == Node.INVALID) {
|
||||
if (handle != null) {
|
||||
node = handle.getNode(core.app.getWrappedNodeManager());
|
||||
if (node != null) {
|
||||
String protoname = node.getPrototype();
|
||||
// the actual prototype name may vary from the node handle's prototype name
|
||||
if (className == null || !className.equals(protoname)) {
|
||||
|
@ -1159,9 +1160,11 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
|||
className = protoname;
|
||||
setPrototype(proto);
|
||||
}
|
||||
} else {
|
||||
// we probably have a deleted node. Replace with empty transient node
|
||||
// to avoid throwing an exception.
|
||||
}
|
||||
}
|
||||
if (node == null || node.getState() == Node.INVALID) {
|
||||
// We probably have a deleted node.
|
||||
// Replace with empty transient node to avoid throwing an exception.
|
||||
node = new Node("DeletedNode", null, core.app.getWrappedNodeManager());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue