EventsEdit: Handle no events existing
This commit is contained in:
parent
5cc310384e
commit
e45e51ef7a
1 changed files with 3 additions and 1 deletions
|
@ -84,7 +84,9 @@ const schedule = useSchedule();
|
|||
const eventSelect = useTemplateRef("eventSelect");
|
||||
|
||||
function onChange(event: any) {
|
||||
const newEvent = schedule.value.events.find(e => e.id === event.target.value)!;
|
||||
const newEvent = schedule.value.events.find(e => e.id === event.target.value);
|
||||
if (!newEvent)
|
||||
return;
|
||||
const form = event.target.form!;
|
||||
for (const element of form.elements as any) {
|
||||
if (element.name === "name") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue