Prevent error if node is not set, just use the root's egw

This commit is contained in:
Nathan Gray 2012-04-30 23:22:14 +00:00
parent 7184574fab
commit 725e8c25ac

View File

@ -713,8 +713,11 @@ var et2_widget = Class.extend({
if (this.implements(et2_IDOMNode))
{
var node = this.getDOMNode();
if(node && node.ownerDocument)
{
wnd = node.ownerDocument.parentNode || node.ownerDocument.defaultView;
}
}
// If we're the root object, return the phpgwapi API instance
return egw('phpgwapi', wnd);