when setParent was called with a second argument of null, it was

delivered as string "null"
This commit is contained in:
hns 2001-02-08 20:57:33 +00:00
parent 223ed97251
commit cfad0969b9

View file

@ -294,15 +294,16 @@ public class ESNode extends ObjectPrototype {
if (!(pval[0] instanceof ESNode)) if (!(pval[0] instanceof ESNode))
return false; return false;
ESNode esn = (ESNode) pval[0]; ESNode esn = (ESNode) pval[0];
INode n = esn.getNode (); INode pn = esn.getNode ();
if (!(n instanceof helma.objectmodel.db.Node)) if (!(pn instanceof helma.objectmodel.db.Node))
return false; return false;
// check if there is an additional string element - if so, it's the property name by which the node is // check if there is an additional string element - if so, it's the property name by which the node is
// accessed, otherwise it will be accessed as anonymous subnode via its id // accessed, otherwise it will be accessed as anonymous subnode via its id
if (pval.length == 2) String propname = null;
((helma.objectmodel.db.Node) node).setParent ((helma.objectmodel.db.Node) n, pval[1].toString ()); if (pval.length == 2 && pval[1] != null && !(pval[1] instanceof ESNull))
else propname = pval[1].toString ();
((helma.objectmodel.db.Node) node).setParent ((helma.objectmodel.db.Node) n, null); helma.objectmodel.db.Node n = (helma.objectmodel.db.Node) node;
n.setParent ((helma.objectmodel.db.Node) pn, propname);
return true; return true;
} }