Skip to content

Commit d497177

Browse files
authored
Merge pull request Eonasdan#1702 from petester42/fix-console-error
Fix 'control space' crash when widget is not present
2 parents 5c09f6d + fd3e25f commit d497177

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/js/bootstrap-datetimepicker.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2596,6 +2596,9 @@
25962596
// if(toggle.length > 0) toggle.click();
25972597
//},
25982598
'control space': function (widget) {
2599+
if (!widget) {
2600+
return;
2601+
}
25992602
if (widget.find('.timepicker').is(':visible')) {
26002603
widget.find('.btn[data-action="togglePeriod"]').click();
26012604
}

0 commit comments

Comments
 (0)