diff --git a/src/main.lua b/src/main.lua index f1ffaf7..79f16e2 100644 --- a/src/main.lua +++ b/src/main.lua @@ -647,6 +647,9 @@ local function VP_createstack(buf, dimensions) end local function VP_splitstack(_stack, x) local stack = _stack["stacks"] + if #stack == 0 then + error("Internal error, splitstack received 0 stacks. There is nothing to split.") + end local dimensions = _stack["dimensions"] local sx = dimensions["sx"] local sz = dimensions["sz"]