patch from Joe Atzberger to silence some JS console warnings
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 25 Nov 2009 13:41:18 +0000 (13:41 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 25 Nov 2009 13:41:18 +0000 (13:41 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15023 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/summary.js

index 33bde75..ccd20e9 100644 (file)
@@ -273,7 +273,7 @@ patron.summary.prototype = {
                         function(e) {
                             return function() { 
                                 var val = obj.patron.ident_value();
-                                val = val.replace(/.+(\d\d\d\d)$/,'xxxx$1');
+                                if (val) val = val.replace(/.+(\d\d\d\d)$/,'xxxx$1');   // must avoid val.replace if val is NULL
                                 util.widgets.set_text(e, val);
                             };
                         }
@@ -298,7 +298,7 @@ patron.summary.prototype = {
                         function(e) {
                             return function() { 
                                 var val = obj.patron.ident_value2();
-                                val = val.replace(/.+(\d\d\d\d)$/,'xxxx$1');
+                                if (val) val = val.replace(/.+(\d\d\d\d)$/,'xxxx$1');   // must avoid val.replace if val is NULL
                                 util.widgets.set_text(e, val);
                             };
                         }