1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-17 08:43:21 +00:00

Added NULL check on uncaught exceptions

This commit is contained in:
Bryan Roe
2019-02-12 17:56:27 -08:00
parent e6dca12458
commit d491aeb98f

View File

@@ -450,6 +450,7 @@ duk_ret_t ILibDuktape_Process_UncaughtExceptionExGetter(duk_context *ctx)
} }
void ILibDuktape_Process_UncaughtExceptionEx(duk_context *ctx, char *format, ...) void ILibDuktape_Process_UncaughtExceptionEx(duk_context *ctx, char *format, ...)
{ {
if (ctx == NULL) { return; }
char dest[4096]; char dest[4096];
int len = 0; int len = 0;
va_list argptr; va_list argptr;
@@ -500,7 +501,7 @@ void ILibDuktape_Process_UncaughtExceptionEx(duk_context *ctx, char *format, ...
// Error MUST be at top of stack when calling this method // Error MUST be at top of stack when calling this method
void ILibDuktape_Process_UncaughtException(duk_context *ctx) void ILibDuktape_Process_UncaughtException(duk_context *ctx)
{ {
ILibDuktape_Process_UncaughtExceptionEx(ctx, ""); if (ctx != NULL) { ILibDuktape_Process_UncaughtExceptionEx(ctx, ""); }
} }
char* Duktape_GetContextGuidHex(duk_context *ctx) char* Duktape_GetContextGuidHex(duk_context *ctx)
{ {