mirror of
https://github.com/vishapoberon/vipak.git
synced 2026-04-05 20:42:26 +00:00
prevent deref of NIL if Dependencies section exists but is empty.
This commit is contained in:
parent
9aae54c17e
commit
7278ee3f52
1 changed files with 16 additions and 14 deletions
|
|
@ -367,20 +367,22 @@ BEGIN
|
|||
IF foundDepSection THEN
|
||||
WHILE rootObj # NIL DO
|
||||
depsValue := rootObj.value;
|
||||
IF depsValue IS Json.Obj THEN
|
||||
singleDep := depsValue(Json.Obj);
|
||||
WHILE singleDep # NIL DO
|
||||
IF singleDep IS Json.Obj THEN
|
||||
depObj := singleDep(Json.Obj);
|
||||
depName := depObj.name;
|
||||
depVersion := depObj.value(Json.Str).str;
|
||||
IF depstrlist = NIL THEN depstrlist := StringList.Create() END;
|
||||
depstrlist.AppendString(depstrlist, depName^);
|
||||
singleDep := depObj.next; (* Move to the next dependency *)
|
||||
END;
|
||||
END; (* End of inner WHILE loop for dependencies *)
|
||||
RETURN depstrlist.Count;
|
||||
END; (* End of IF depsValue IS Json.Obj *)
|
||||
IF depsValue # NIL THEN
|
||||
IF depsValue IS Json.Obj THEN
|
||||
singleDep := depsValue(Json.Obj);
|
||||
WHILE singleDep # NIL DO
|
||||
IF singleDep IS Json.Obj THEN
|
||||
depObj := singleDep(Json.Obj);
|
||||
depName := depObj.name;
|
||||
depVersion := depObj.value(Json.Str).str;
|
||||
IF depstrlist = NIL THEN depstrlist := StringList.Create() END;
|
||||
depstrlist.AppendString(depstrlist, depName^);
|
||||
singleDep := depObj.next; (* Move to the next dependency *)
|
||||
END;
|
||||
END; (* End of inner WHILE loop for dependencies *)
|
||||
RETURN depstrlist.Count;
|
||||
END; (* End of IF depsValue IS Json.Obj *)
|
||||
END;
|
||||
rootObj := rootObj.next; (* Move to the next JSON object *)
|
||||
END; (* End of WHILE rootObj # NIL loop *)
|
||||
ELSE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue