[FIX] web: TempusDominus unsafe access to config
During TempusDominus autobinding to fields matching its default classes (like `.datetimepicker-input` used by our DatePicker widget) and no config was previously provided to the library (like when we disable it on mobile), an unsafe access to the config's `_options` property results into an error as the config is `undefined`. This commit fixes it by first checking for config existence before attempting to access its property. Note: as this is a fix inside a library, a comment is added to make clear. Also similar fixes where already done in the same file. opw-2242880 X-original-commit: fe1f7c3e361bbd249b4025a464c546f478b6e989
This commit is contained in:
@@ -2777,7 +2777,8 @@ var TempusDominusBootstrap4 = function ($) {
|
||||
if ($target.length === 0) {
|
||||
return;
|
||||
}
|
||||
if (!config._options.allowInputToggle) {
|
||||
// /!\ ODOO FIX: check on 'config' existence added by odoo
|
||||
if (!(config && config._options.allowInputToggle)) {
|
||||
return;
|
||||
}
|
||||
TempusDominusBootstrap4._jQueryInterface.call($target, 'show', event);
|
||||
|
||||
Reference in New Issue
Block a user