Skip to content

Commit 056b5e9

Browse files
committed
fix: crash in SQL export to database for zero length SQL, plus upgrade old-style string handling
1 parent 0422bb3 commit 056b5e9

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

source/apphelpers.pas

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,10 +713,13 @@ function EncodeURLParam(const Value: String): String;
713713
}
714714
procedure StreamWrite(S: TStream; Text: String = '');
715715
var
716-
utf8: AnsiString;
716+
utf8: UTF8String;
717+
L: Integer;
717718
begin
718719
utf8 := Utf8Encode(Text);
719-
S.Write(utf8[1], Length(utf8));
720+
L := Length(utf8);
721+
if L > 0 then
722+
S.WriteBuffer(utf8[1], L);
720723
end;
721724

722725

0 commit comments

Comments
 (0)