Fix null pointer dereference introduced by 8aec4a0cef
This commit is contained in:
parent
7618cbffc2
commit
d762db2db8
1 changed files with 1 additions and 1 deletions
|
@ -1870,11 +1870,11 @@ public:
|
||||||
cJSON *createJSONArrayFromPathList(const PathList& pl) const
|
cJSON *createJSONArrayFromPathList(const PathList& pl) const
|
||||||
{
|
{
|
||||||
cJSON *resultNode = cJSON_CreateArray();
|
cJSON *resultNode = cJSON_CreateArray();
|
||||||
|
cJSON *prevNode = nullptr;
|
||||||
bool isFirst = true;
|
bool isFirst = true;
|
||||||
|
|
||||||
for (const SGPath& path : pl) {
|
for (const SGPath& path : pl) {
|
||||||
cJSON *pathNode = cJSON_CreateString(path.utf8Str().c_str());
|
cJSON *pathNode = cJSON_CreateString(path.utf8Str().c_str());
|
||||||
cJSON *prevNode = nullptr;
|
|
||||||
|
|
||||||
if (isFirst) {
|
if (isFirst) {
|
||||||
isFirst = false;
|
isFirst = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue