gui/event-editor/date-time-chooser: Exit if 12-hour time entry is invalid

If the user has 12h time and sets a properly formatted but invalid time,
Calendar would crash because `date_time` would be `NULL`. This would
specifically happen if the time was set over 23:59 AM or 11:59 PM (ex:
19:00 PM).

By breaking if `date_time` is `NULL`, the crash can be avoided.

Closes #1602

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/848>
This commit is contained in:
ARAKHNID
2026-09-25 23:55:31 +00:00
committed by Marge Bot
parent bf8e9929e3
commit ff2689b0f2
@@ -287,6 +287,9 @@ validate_and_normalize_time_entry (GcalDateTimeChooser *self)
g_date_time_get_day_of_month (self->date_time),
hour, minute, 0);
if (!date_time)
break;
gcal_date_time_chooser_set_date_time (self, date_time);
}
break;