Skip to content

Commit

Permalink
Make sure output is string or undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdailis committed Oct 21, 2024
1 parent 1b4a1b4 commit 9a508db
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/sequencing/SequenceEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,13 @@
const tree = syntaxTree(viewUpdate.state);
let output = await selectedOutputFormat?.toOutputFormat?.(tree, sequence, commandDictionary, sequenceName);
// Make sure that output is string | undefined
if (output !== undefined) {
output = `${output}`;
}
if ($sequenceAdaptation?.modifyOutput !== undefined && output !== undefined) {
output = $sequenceAdaptation?.modifyOutput(output, parameterDictionaries, channelDictionary);
output = `${$sequenceAdaptation?.modifyOutput(output, parameterDictionaries, channelDictionary)}`;
}
editorOutputView.dispatch({ changes: { from: 0, insert: output, to: editorOutputView.state.doc.length } });
Expand Down

0 comments on commit 9a508db

Please sign in to comment.