From 12fe89b0b930500e694f5b977f6b4a48f4af8137 Mon Sep 17 00:00:00 2001 From: garret Date: Fri, 13 Jan 2023 01:31:51 +0000 Subject: shenanigan script: dont crash with non-script effects oops --- macros/garret.shenanigans.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'macros/garret.shenanigans.lua') diff --git a/macros/garret.shenanigans.lua b/macros/garret.shenanigans.lua index 0f8ff3c..bce22fc 100644 --- a/macros/garret.shenanigans.lua +++ b/macros/garret.shenanigans.lua @@ -1,7 +1,7 @@ script_name = "Import Shenanigans" script_description = "imports shenanigans" script_author = "garret" -script_version = "0.1.0" +script_version = "0.1.1" script_namespace = "garret.shenanigans" local SHENAN_PATTERN = "shenan ([^;]*)" @@ -52,7 +52,9 @@ local function main(sub) aegisub.log(5, i..": has effect: "..line.effect) local name = line.effect:match(SHENAN_PATTERN) local shenans = imports[name] - if shenans ~= "done" then + if shenans == nil then + + elseif shenans ~= "done" then for idx, val in ipairs(shenans) do sub.insert(i + idx, val) end -- cgit v1.2.3-70-g09d2