Skip to content

Range Check Error in TMVCStreamHelper #386

@dipold

Description

@dipold

Case the Range checking is True in Project Options > Delphi Compiler > Compiling, I am getting Range check error when AString is empty in this code:

Self.WriteBuffer(UFTStr[low(UFTStr)], Length(UFTStr));

I think it would be enough to check if the parameter is empty:

procedure TMVCStreamHelper.WriteUTF8(const AString: string);
var
  UFTStr: UTF8String;
begin
  UFTStr := UTF8String(AString);
  if (UFTStr <> '') then
    Self.WriteBuffer(UFTStr[Low(UFTStr)], Length(UFTStr));
end;

Metadata

Metadata

Assignees

Labels

acceptedIssue has been accepted and inserted in a future milestone

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions