From b08a2387a0d677843b4a0cba9ef636439b9534cf Mon Sep 17 00:00:00 2001 From: Jonathan Rosenbaum Date: Tue, 2 Jan 2018 06:54:26 +0000 Subject: [PATCH] Avoids unnecessary error, related to #56. --- js/transaction.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/transaction.js b/js/transaction.js index d66ad50..a0cb836 100644 --- a/js/transaction.js +++ b/js/transaction.js @@ -1303,9 +1303,11 @@ $(function() { // more than max_bike_limit turn off spinner if ($("#transaction_type").val() === "Bicycles") { - if (volunteer && obj.max_bike_earned) { - if (volunteer[year].max_bike_earned >= obj.max_bike_earned) { - $("#redeemable_hours").spinner("disable"); + if (volunteer && obj.max_bike_earned) { + if (volunteer.hasOwnProperty(year)) { + if (volunteer[year].max_bike_earned >= obj.max_bike_earned) { + $("#redeemable_hours").spinner("disable"); + } } } }