You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2012/10/08 09:26:02 UTC

svn commit: r1395460 - /ofbiz/trunk/framework/images/webapp/images/fieldlookup.js

Author: jleroux
Date: Mon Oct  8 07:26:02 2012
New Revision: 1395460

URL: http://svn.apache.org/viewvc?rev=1395460&view=rev
Log:
A patch from Leon "very trivial update to fieldlookup.js in case of "null object" failure for weird unknonw reason" https://issues.apache.org/jira/browse/OFBIZ-4911

I cannot find the root cause and it's hard to reproduce, but it does happen sometimes. The web browser reports "null object" exception when it tries to evaluate following codes in fieldlookup.js: 
{quote}
var obj_caller = (window.opener? window.opener.lookups[num_id]: null);
{quote}

window.opener is there but window.opener.lookups is null.

jleroux: better be safe than sorry, even if it hides the original reason this no functional change can't have any side effects.

Modified:
    ofbiz/trunk/framework/images/webapp/images/fieldlookup.js

Modified: ofbiz/trunk/framework/images/webapp/images/fieldlookup.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/fieldlookup.js?rev=1395460&r1=1395459&r2=1395460&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/fieldlookup.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/fieldlookup.js Mon Oct  8 07:26:02 2012
@@ -719,7 +719,7 @@ function lookupPaginationAjaxRequest(nav
  ******************************************************************************/
 var re_id = new RegExp('id=(\\d+)');
 var num_id = (re_id.exec(String(window.location)) ? new Number(RegExp.$1) : 0);
-var obj_caller = (window.opener ? window.opener.lookups[num_id] : null);
+var obj_caller = (window.opener && window.opener.lookups? window.opener.lookups[num_id]: null);
 if (obj_caller == null && window.opener != null) {
 	obj_caller = window.opener;
 } else if (obj_caller == null && window.opener == null) {