diff --git a/api/js/etemplate/etemplate2.ts b/api/js/etemplate/etemplate2.ts index cb764b7a00..dfbdd4aed6 100644 --- a/api/js/etemplate/etemplate2.ts +++ b/api/js/etemplate/etemplate2.ts @@ -1710,10 +1710,15 @@ export class etemplate2 (widget).showMessage(_response.data[id], 'validation_error'); } - else if(typeof widget.set_validation_error == "function") + else if(widget && typeof widget.set_validation_error == "function") { widget.set_validation_error(_response.data[id]); } + else if(!widget) + { + console.warn(`Validation error without widget. ID:${id} - ${_response.data[id]}`); + continue; + } // Handle validation_error (messages coming back from server as a response) if widget is children of a tabbox let tmpWidget = widget; while(tmpWidget.getParent() && tmpWidget.getType() !== 'ET2-TABBOX')