Skip to content

Commit e53291b

Browse files
committed
fix for tests
1 parent 2521ee8 commit e53291b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

dash/dash-renderer/src/actions/callbacks.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -582,11 +582,13 @@ function inputsToDict(inputs_list: any) {
582582
function getTriggeredId(triggered: string[]): string | object {
583583
// for regular callbacks, takes the first triggered prop_id, e.g. "btn.n_clicks" and returns "btn"
584584
// for pattern matching callback, e.g. '{"index":0, "type":"btn"}' and returns {index:0, type: "btn"}'
585-
let componentId = triggered[0].split('.')[0];
586-
if (componentId.startsWith('{')) {
587-
componentId = JSON.parse(componentId);
585+
if (triggered && triggered.length) {
586+
let componentId = triggered[0].split('.')[0];
587+
if (componentId.startsWith('{')) {
588+
componentId = JSON.parse(componentId);
589+
}
590+
return componentId;
588591
}
589-
return componentId;
590592
}
591593

592594
export function executeCallback(

0 commit comments

Comments
 (0)