Author: jleroux
Date: Mon Oct  8 09:22:41 2012
New Revision: 1395488

URL: http://svn.apache.org/viewvc?rev=1395488&view=rev
Log:
"Applied fix from trunk for revision: 1395460" 
------------------------------------------------------------------------
r1395460 | jleroux | 2012-10-08 09:26:02 +0200 (lun., 08 oct. 2012) | 10 lines

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/branches/release10.04/   (props changed)
    ofbiz/branches/release10.04/framework/images/webapp/images/fieldlookup.js

Propchange: ofbiz/branches/release10.04/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1395460

Modified: 
ofbiz/branches/release10.04/framework/images/webapp/images/fieldlookup.js
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/release10.04/framework/images/webapp/images/fieldlookup.js?rev=1395488&r1=1395487&r2=1395488&view=diff
==============================================================================
--- ofbiz/branches/release10.04/framework/images/webapp/images/fieldlookup.js 
(original)
+++ ofbiz/branches/release10.04/framework/images/webapp/images/fieldlookup.js 
Mon Oct  8 09:22:41 2012
@@ -871,8 +871,8 @@ function lookupPaginationAjaxRequest(nav
 * This code inserts the value lookedup by a popup window back into the 
associated form element
 
*******************************************************************************************************/
 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 num_id = (re_id.exec(String(window.location)) ? new Number(RegExp.$1) : 0);
+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) {


Reply via email to