diff --git a/ide/packages/idedebugger/idedebuggerwatchresutils.pas b/ide/packages/idedebugger/idedebuggerwatchresutils.pas index add337111e..f91970b376 100644 --- a/ide/packages/idedebugger/idedebuggerwatchresutils.pas +++ b/ide/packages/idedebugger/idedebuggerwatchresutils.pas @@ -577,10 +577,13 @@ function TStringBuilderPart.GetFullString: String; var p: PChar; begin + Result := ''; if FData = nil then - exit(''); + exit(); if FType = sbfString then exit(string(FData)); + if PHeader(FData)^.FTotalLen = 0 then + exit; SetLength(Result, PHeader(FData)^.FTotalLen); p := pchar(Result);