chore(edge-renderer): accept invalid handleid config

This commit is contained in:
moklick
2023-03-13 13:34:37 +01:00
parent 97756dee60
commit 05b5781881

View File

@@ -77,10 +77,10 @@ export function getHandle(bounds: HandleElement[], handleId?: string | null): Ha
return null;
}
if (handleId) {
return bounds.find((d) => d.id === handleId)!;
} else if (bounds.length === 1) {
if (bounds.length === 1 || !handleId) {
return bounds[0];
} else if (handleId) {
return bounds.find((d) => d.id === handleId) || null;
}
return null;