From 98fe538e564bac10e5df65c31e20b8dc3317e87d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 15 Jun 2022 15:25:38 +0800 Subject: fix --- script/vm/runner.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'script/vm/runner.lua') diff --git a/script/vm/runner.lua b/script/vm/runner.lua index a9c38a87..e7851b49 100644 --- a/script/vm/runner.lua +++ b/script/vm/runner.lua @@ -114,6 +114,9 @@ end ---@param outNode? vm.node ---@return vm.node function mt:_lookInto(action, topNode, outNode) + if not action then + return topNode, outNode + end local set local value = vm.getObjectValue(action) if value then @@ -128,7 +131,9 @@ function mt:_lookInto(action, topNode, outNode) self:_launchBlock(action, topNode:copy()) elseif action.type == 'while' then local blockNode, mainNode = self:_lookInto(action.filter, topNode:copy(), topNode:copy()) - self:_fastWard(action.filter.finish, blockNode) + if action.filter then + self:_fastWard(action.filter.finish, blockNode) + end self:_launchBlock(action, blockNode:copy()) topNode = mainNode elseif action.type == 'if' then @@ -201,7 +206,7 @@ function mt:_lookInto(action, topNode, outNode) end end if loc then - self:_fastWard(loc.finish, topNode) + self:_fastWard(loc.finish, topNode:copy()) if guide.isLiteral(checker) then local checkerNode = vm.compileNode(checker) if action.op.type == '==' then -- cgit v1.2.3