Skip to content
Prev Previous commit
Next Next commit
fix: Handle undefined node in section entities
  • Loading branch information
MindFreeze committed Jan 27, 2026
commit c09a5a21275457400964970204919a9666e08ebe
3 changes: 2 additions & 1 deletion src/editor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export class SankeyChartEditor extends LitElement implements LovelaceCardEditor
if (!section) return;

const nodeInternal = section.entities[target.index];
if (!nodeInternal) return;
const nodeId = nodeInternal.id;

// Find node in config
Expand All @@ -140,7 +141,7 @@ export class SankeyChartEditor extends LitElement implements LovelaceCardEditor

const newConf = typeof value === 'string' ? { id: value } : value;

if (!newConf.id) {
if (!newConf || !newConf.id) {
// Deleting node - remove from nodes and clean up links
this._config = {
...this._config!,
Expand Down