From 163982bc6ea96171bc1d500cb54434d25ef83d9f Mon Sep 17 00:00:00 2001 From: cheatfate Date: Sat, 27 Oct 2018 20:08:19 +0300 Subject: [PATCH] Add assert on callSoon(nil) --- asyncdispatch2/asyncloop.nim | 1 + 1 file changed, 1 insertion(+) diff --git a/asyncdispatch2/asyncloop.nim b/asyncdispatch2/asyncloop.nim index 7301355..e88a010 100644 --- a/asyncdispatch2/asyncloop.nim +++ b/asyncdispatch2/asyncloop.nim @@ -745,6 +745,7 @@ include asyncmacro2 proc callSoon(cbproc: CallbackFunc, data: pointer = nil) = ## Schedule `cbproc` to be called as soon as possible. ## The callback is called when control returns to the event loop. + assert cbproc != nil let acb = AsyncCallback(function: cbproc, udata: data) getGlobalDispatcher().callbacks.addLast(acb)