Skip to content

Commit 3447a62

Browse files
committed
js: Do not fail while trying to detect autosubmit element
fixes #5439 (cherry picked from commit 9b63928)
1 parent 439b89e commit 3447a62

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

public/js/icinga/behavior/modal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
}
115115

116116
let $autoSubmittedBy;
117-
if (typeof event.detail !== 'undefined' && "submittedBy" in event.detail) {
117+
if (event.detail !== null && typeof event.detail === 'object' && "submittedBy" in event.detail) {
118118
$autoSubmittedBy = $(event.detail.submittedBy);
119119
}
120120

public/js/icinga/events.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,11 @@
261261
}
262262
}
263263

264-
if (! $autoSubmittedBy && typeof event.detail !== 'undefined' && "submittedBy" in event.detail) {
264+
if (! $autoSubmittedBy
265+
&& event.detail !== null
266+
&& typeof event.detail === 'object'
267+
&& "submittedBy" in event.detail
268+
) {
265269
$autoSubmittedBy = $(event.detail.submittedBy);
266270
}
267271

0 commit comments

Comments
 (0)