web staff: sanity check isbn/issn's before scrubbing
authorBill Erickson <berick@esilibrary.com>
Mon, 3 Mar 2014 17:46:31 +0000 (12:46 -0500)
committerBill Erickson <berick@esilibrary.com>
Mon, 3 Mar 2014 17:46:31 +0000 (12:46 -0500)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/web/js/ui/default/staff/cat/bucket/record/app.js

index 1497c7f..eedd805 100644 (file)
@@ -346,10 +346,14 @@ function($scope,  $location,  $q,  $timeout,  $modal,
 
                 // apply some data munging to make the list values 
                 // of 'rmsr' more human friendly.
-                record.isbn = record.isbn.replace(/\{NULL\}/,'');
-                record.issn = record.issn.replace(/\{NULL\}/,'');
-                record.isbn = record.isbn.replace(/\{(.*)\}/,'$1');
-                record.issn = record.issn.replace(/\{(.*)\}/,'$1');
+                if (record.isbn) {
+                    record.isbn = record.isbn.replace(/\{NULL\}/,'');
+                    record.isbn = record.isbn.replace(/\{(.*)\}/,'$1');
+                }
+                if (record.issn) {
+                    record.issn = record.issn.replace(/\{NULL\}/,'');
+                    record.issn = record.issn.replace(/\{(.*)\}/,'$1');
+                }
                 $scope.pageList.items.push(record);
             }
         );