From a8155f594112cfbb96ae7eb1af330f303f679824 Mon Sep 17 00:00:00 2001 From: NullBite <me@nullbite.com> Date: Mon, 26 Jun 2023 02:13:12 -0400 Subject: [PATCH] Add assertions to statemonitor.register --- statemonitor.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/statemonitor.lua b/statemonitor.lua index 5536924..757cb5a 100644 --- a/statemonitor.lua +++ b/statemonitor.lua @@ -22,6 +22,8 @@ end function statemonitor.register(name, check, callback, frequency, once) frequency=frequency or 5 once=ternary(once ~= nil, once, true) + assert(type(callback)=="function") + assert(type(check)=="function") callbacks[name] = {check=check, callback=callback, f=frequency, deregister=once} end