1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-05 18:13:38 +00:00

Added additional check to verify if emitter was finalized

This commit is contained in:
Bryan Roe
2019-01-31 14:38:51 -08:00
parent a6cbc1a9c1
commit 0cb052fcc6

View File

@@ -191,7 +191,7 @@ duk_ret_t ILibDuktape_EventEmitter_emit(duk_context *ctx)
self = duk_get_heapptr(ctx, -1);
duk_pop(ctx); // ...
if (data->eventTable == NULL) { duk_push_false(ctx); return(1); } // This probably means the finalizer was already run on the eventEmitter
if (data->eventTable == NULL || data->ctx == NULL) { duk_push_false(ctx); return(1); } // This probably means the finalizer was already run on the eventEmitter
eventList = ILibHashtable_Get(data->eventTable, NULL, name, (int)nameLen);
if (eventList == NULL)