LP#1722899 - Fix bug due undefined pay note value
authorCesar Velez <cesar.velez@equinoxinitiative.org>
Thu, 2 Nov 2017 19:39:38 +0000 (15:39 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 7 Nov 2017 16:55:09 +0000 (11:55 -0500)
Prevent error due to null or undefined pay_note.value

Signed-off by: Cesar Velez <cesar.velez@equinoxinitiative.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/web/js/ui/default/staff/circ/patron/bills.js

index 5b7c079..8f06491 100644 (file)
@@ -503,7 +503,8 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
             function() { // amount confirmed
                 add_payment_note().then(function(pay_note) {
                     add_cc_args().then(function(cc_args) {
-                        sendPayment(pay_note.value, cc_args);
+                        var note_text = pay_note ? pay_note.value || '' : null;
+                        sendPayment(note_text, cc_args);
                     })
                 });
             },