LP#1722899 - Fix bug due undefined pay note value user/cesardv/lp1722899_fix_patron_billpayment_annotate
authorCesar Velez <cesar.velez@equinoxinitiative.org>
Thu, 2 Nov 2017 19:39:38 +0000 (15:39 -0400)
committerCesar Velez <cesar.velez@equinoxinitiative.org>
Thu, 2 Nov 2017 19:39:38 +0000 (15:39 -0400)
Prevent error due to null or undefined pay_note.value

Signed-off by: Cesar Velez <cesar.velez@equinoxinitiative.org>

Open-ILS/web/js/ui/default/staff/circ/patron/bills.js

index daa5ae4..1ead1cc 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);
                     })
                 });
             },