From 44437e84f13230afa5cd8675af2234aceda7c263 Mon Sep 17 00:00:00 2001 From: Alessandro Proto Date: Fri, 17 Mar 2023 22:38:25 +0100 Subject: [PATCH] Add checks against fulfill nil values --- Capy64/Runtime/Libraries/Event.cs | 1 + Capy64/Runtime/Objects/Task.cs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Capy64/Runtime/Libraries/Event.cs b/Capy64/Runtime/Libraries/Event.cs index a9690ea..b060329 100644 --- a/Capy64/Runtime/Libraries/Event.cs +++ b/Capy64/Runtime/Libraries/Event.cs @@ -194,6 +194,7 @@ public class Event : IComponent var task = TaskMeta.CheckTask(L, false); L.CheckAny(2); + L.ArgumentCheck(!L.IsNil(2), 2, "value cannot be nil"); if(!task.UserTask) { diff --git a/Capy64/Runtime/Objects/Task.cs b/Capy64/Runtime/Objects/Task.cs index b2a5bc9..05d2f92 100644 --- a/Capy64/Runtime/Objects/Task.cs +++ b/Capy64/Runtime/Objects/Task.cs @@ -64,6 +64,10 @@ public class TaskMeta : IComponent var container = tasks.NewThread(); lk(container); + if(container.IsNil(-1)) + { + throw new Exception("Task result cannot be nil"); + } container.XMove(tasks, 1); tasks.Remove(-2); var emptySpot = FindSpot();