diff --git a/Engine/typesystem_engine.xml b/Engine/typesystem_engine.xml index b9780309b7..8201088a43 100644 --- a/Engine/typesystem_engine.xml +++ b/Engine/typesystem_engine.xml @@ -1497,7 +1497,7 @@ PyObject* subList = PyList_GET_ITEM(%PYARG_1,i); - if (!subList) { + if (!subList || !PyList_Check(subList)) { PyErr_SetString(PyExc_TypeError, "table must be a list of list objects."); return 0; } @@ -1506,7 +1506,7 @@ for (int j = 0; j < subSize; ++j) { PyObject* pyString = PyList_GET_ITEM(subList,j); - if ( PyUnicode_Check(pyString) ) { + if ( PyString_Check(pyString) || PyUnicode_Check(pyString) ) { PyObject* utf8pyobj = PyUnicode_AsUTF8String(pyString); // newRef if (utf8pyobj) {