Ensure grid options always return an object (#25760)

This commit is contained in:
Paul Bottein 2025-06-12 09:44:20 +02:00 committed by GitHub
parent af6911e848
commit 01d2ef13c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -96,7 +96,9 @@ export class HuiCard extends ReactiveElement {
if (!this._element) return {}; if (!this._element) return {};
if (this._element.getGridOptions) { if (this._element.getGridOptions) {
return this._element.getGridOptions(); const options = this._element.getGridOptions();
// Some custom cards might return undefined, so we ensure we return an object
return options || {};
} }
if (this._element.getLayoutOptions) { if (this._element.getLayoutOptions) {
// Disabled for now to avoid spamming the console, need to be re-enabled when hui-card performance are fixed // Disabled for now to avoid spamming the console, need to be re-enabled when hui-card performance are fixed