null and undefined are objects too

fixes TypeError: Cannot read properties of null (reading 'length')
This commit is contained in:
ralf 2023-04-26 09:22:30 +02:00
parent 7d86d69b49
commit a50fa29419

View File

@ -369,7 +369,7 @@ const Et2InputWidgetMixin = <T extends Constructor<LitElement>>(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
);
}