Bug 30650: Prevent browser crash if no pickup interval set

Don't get stuck in an infinite loop

Signed-off-by: Koha Team University Lyon 3 <koha@univ-lyon3.fr>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2022-06-15 11:27:19 +02:00 committed by Tomas Cohen Arazi
parent 50f8cce211
commit 56e1ce35ab
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
2 changed files with 8 additions and 0 deletions

View File

@ -550,6 +550,10 @@
slots_per_day[dow].forEach(function(slot){
let pickup_interval = policy.pickup_interval;
if (!pickup_interval) {
$('#pickup-times').html("<div>"+_("No pickup time define for this day.")+"</div>");
return;
}
let listStartMoment = selectedDate.hour(slot.start_hour).minute(slot.start_minute);
let listEndMoment = selectedDate.hour(slot.end_hour).minute(slot.end_minute);

View File

@ -310,6 +310,10 @@
policy.slots_per_day[dow].forEach(function(slot){
let pickup_interval = policy.pickup_interval;
if (!pickup_interval) {
$('#pickup-times').html("<div>"+_("No pickup time define for this day.")+"</div>");
return;
}
let listStartMoment = selectedDate.hour(slot.start_hour).minute(slot.start_minute);
let listEndMoment = selectedDate.hour(slot.end_hour).minute(slot.end_minute);