diff --git a/src/script/api/script_admin.cpp b/src/script/api/script_admin.cpp index 42615d2aed..9f55e1b958 100644 --- a/src/script/api/script_admin.cpp +++ b/src/script/api/script_admin.cpp @@ -129,7 +129,10 @@ } std::string json; - ScriptAdmin::MakeJSON(vm, -1, SQUIRREL_MAX_DEPTH, json); + if (!ScriptAdmin::MakeJSON(vm, -1, SQUIRREL_MAX_DEPTH, json)) { + sq_pushinteger(vm, 0); + return 1; + } if (json.length() > NETWORK_GAMESCRIPT_JSON_LENGTH) { ScriptLog::Error("You are trying to send a table that is too large to the AdminPort. No data sent.");