From 8895ae5e0d1e6ad3f3962a6c9746bd5997e687fd Mon Sep 17 00:00:00 2001 From: zuu Date: Thu, 3 Oct 2013 16:47:24 +0000 Subject: (svn r25809) -Fix: [Script] Decoding JSON data with an empty array from Admin port failed --- src/script/api/script_event_types.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/script/api/script_event_types.cpp b/src/script/api/script_event_types.cpp index 0e1683440..f22bb2f61 100644 --- a/src/script/api/script_event_types.cpp +++ b/src/script/api/script_event_types.cpp @@ -244,6 +244,14 @@ char *ScriptEventAdminPort::ReadValue(HSQUIRRELVM vm, char *p) /* Array */ sq_newarray(vm, 0); + /* Empty array? */ + char *p2 = p+1; + SKIP_EMPTY(p2); + if (*p2 == ']') { + p = p2+1; + break; + } + while (*p++ != ']') { p = this->ReadValue(vm, p); if (p == NULL) { -- cgit v1.2.3-70-g09d2