Skip to content

Commit aac2433

Browse files
committed
fix: stop trying to parse nodes if there are none
Signed-off-by: Donnie Adams <[email protected]>
1 parent bf8f3e4 commit aac2433

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/gptscript.ts

+4
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,10 @@ function getCmdPath(): string {
838838

839839
function parseBlocksFromNodes(nodes: any[]): Block[] {
840840
const blocks: Block[] = []
841+
if (!nodes) {
842+
return blocks
843+
}
844+
841845
for (const node of nodes) {
842846
if (node.toolNode) {
843847
if (!node.toolNode.tool.id) {

0 commit comments

Comments
 (0)