RT#85191 Legacy billing payment print error repair
authorBill Erickson <berickxx@gmail.com>
Thu, 13 Aug 2015 20:14:22 +0000 (16:14 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Some legacy data has NULL values (e.g. last_billing_note) where current
data has empty strings.  This leads to exceptions and annoying, but
ultimately harmless error dialogs in the XUL client.  Add some sanity
checking to the code to avoid that.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/xul/staff_client/chrome/content/util/print.js

index e257ce9..ee4dce8 100644 (file)
@@ -510,6 +510,11 @@ util.print.prototype = {
                     } else { 
                         /* for dump_with_keys */
                         for (var i in params.row) {
+
+                                // some legacy data has NULL values where empty 
+                                // strings should be.  This dies on .toString().
+                                if (params.row[i] == null) params.row[i] = '';
+
                                 switch(i) {         
                                 case "due_date":          
                                     var re = new RegExp('%'+i+'%',"g");