do_storage(): Unset highlighted item if list is empty
Check if the appointment panel contains any items and unset the highlight counter if it doesn't. Not doing this resulted in core dumps if the edit command was invoked after switching to a day without any appointments/events. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
parent
82942938be
commit
574306ff85
@ -52,8 +52,12 @@ static struct day_items_nb do_storage(int day_changed)
|
||||
struct day_items_nb inday = *day_process_storage(calendar_get_slctd_day(),
|
||||
day_changed, &inday);
|
||||
|
||||
if (day_changed)
|
||||
apoint_hilt_set(1);
|
||||
if (day_changed) {
|
||||
if ((inday.nb_events + inday.nb_apoints) > 0)
|
||||
apoint_hilt_set(1);
|
||||
else
|
||||
apoint_hilt_set(0);
|
||||
}
|
||||
|
||||
return inday;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user