From a50fa29419d7c10b0adf98c5352ce8004b65d1ae Mon Sep 17 00:00:00 2001 From: ralf Date: Wed, 26 Apr 2023 09:22:30 +0200 Subject: [PATCH] null and undefined are objects too fixes TypeError: Cannot read properties of null (reading 'length') --- api/js/etemplate/Et2InputWidget/Et2InputWidget.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts b/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts index 13dda0f777..7a563f4c54 100644 --- a/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts +++ b/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts @@ -369,7 +369,7 @@ const Et2InputWidgetMixin = >(superclass : T) { return this.readonly || this.disabled ? null : ( // Give a clone of objects or receiver might use the reference - typeof this.value == "object" ? (typeof this.value.length == "undefined" ? {...this.value} : [...this.value]) : this.value + this.value && typeof this.value == "object" ? (typeof this.value.length == "undefined" ? {...this.value} : [...this.value]) : this.value ); }