Add missing calls to checkNode()
This commit is contained in:
parent
47e6955aa2
commit
2ab0f17678
1 changed files with 17 additions and 2 deletions
|
@ -192,6 +192,9 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
||||||
* @return the wrapped INode instance
|
* @return the wrapped INode instance
|
||||||
*/
|
*/
|
||||||
public INode getNode() {
|
public INode getNode() {
|
||||||
|
if (node != null) {
|
||||||
|
checkNode();
|
||||||
|
}
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,6 +272,8 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
||||||
|
|
||||||
Map param = RhinoCore.getSkinParam(paramobj);
|
Map param = RhinoCore.getSkinParam(paramobj);
|
||||||
|
|
||||||
|
checkNode();
|
||||||
|
|
||||||
if (skin != null) {
|
if (skin != null) {
|
||||||
skin.render(reval, node, param);
|
skin.render(reval, node, param);
|
||||||
}
|
}
|
||||||
|
@ -303,6 +308,8 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
||||||
|
|
||||||
Map param = RhinoCore.getSkinParam(paramobj);
|
Map param = RhinoCore.getSkinParam(paramobj);
|
||||||
|
|
||||||
|
checkNode();
|
||||||
|
|
||||||
if (skin != null) {
|
if (skin != null) {
|
||||||
reval.res.pushStringBuffer();
|
reval.res.pushStringBuffer();
|
||||||
skin.render(reval, node, param);
|
skin.render(reval, node, param);
|
||||||
|
@ -357,6 +364,8 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
||||||
|
|
||||||
Object n = null;
|
Object n = null;
|
||||||
|
|
||||||
|
checkNode();
|
||||||
|
|
||||||
if (id instanceof Number) {
|
if (id instanceof Number) {
|
||||||
n = node.getSubnodeAt(((Number) id).intValue());
|
n = node.getSubnodeAt(((Number) id).intValue());
|
||||||
} else if (id != null) {
|
} else if (id != null) {
|
||||||
|
@ -411,14 +420,14 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
checkNode();
|
|
||||||
|
|
||||||
if (id instanceof Number) {
|
if (id instanceof Number) {
|
||||||
|
|
||||||
if (!(value instanceof HopObject)) {
|
if (!(value instanceof HopObject)) {
|
||||||
throw new EvaluatorException("Can only set HopObjects as child objects in HopObject.set()");
|
throw new EvaluatorException("Can only set HopObjects as child objects in HopObject.set()");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkNode();
|
||||||
|
|
||||||
int idx = (((Number) id).intValue());
|
int idx = (((Number) id).intValue());
|
||||||
INode n = ((HopObject) value).getNode();
|
INode n = ((HopObject) value).getNode();
|
||||||
|
|
||||||
|
@ -650,6 +659,9 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
||||||
* @return the ID of the newly persisted HopObject or null if operation failed
|
* @return the ID of the newly persisted HopObject or null if operation failed
|
||||||
*/
|
*/
|
||||||
public Object jsFunction_persist() {
|
public Object jsFunction_persist() {
|
||||||
|
|
||||||
|
checkNode();
|
||||||
|
|
||||||
if (node instanceof helma.objectmodel.db.Node) {
|
if (node instanceof helma.objectmodel.db.Node) {
|
||||||
((helma.objectmodel.db.Node) node).persist();
|
((helma.objectmodel.db.Node) node).persist();
|
||||||
return node.getID();
|
return node.getID();
|
||||||
|
@ -684,6 +696,9 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
||||||
* Check if node is contained in subnodes
|
* Check if node is contained in subnodes
|
||||||
*/
|
*/
|
||||||
public int jsFunction_contains(Object obj) {
|
public int jsFunction_contains(Object obj) {
|
||||||
|
|
||||||
|
checkNode();
|
||||||
|
|
||||||
if ((node != null) && obj instanceof HopObject) {
|
if ((node != null) && obj instanceof HopObject) {
|
||||||
checkNode();
|
checkNode();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue