Fix TJSArray._GetStrings: exit once you get correct value, do not fall through to raising error

This commit is contained in:
Michalis Kamburelis 2024-12-08 02:24:05 +01:00 committed by Michaël Van Canneyt
parent e2dd3a09dc
commit 4c8f718a8b

View File

@ -2797,14 +2797,14 @@ begin
else
begin
Str(TJOB_Double(V).Value,S);
Result:=S;
Exit(S);
end;
if V is TJOB_String then
Result:=TJOB_STRING(V).Value;
Exit(TJOB_STRING(V).Value);
finally
V.Free;
end;
Raise EConvertError.CreateFmt('Element %d is not a valid integer value',[Index]);
Raise EConvertError.CreateFmt('Element %d is not a valid string value',[Index]);
end;
procedure TJSArray._SetBooleans(Index: NativeInt; aValue: Boolean);