From d94b9bd4abfced221f17e32e9a1e5fc6b4d01c57 Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 10 Sep 2016 18:43:22 +0000 Subject: [PATCH] * Check for Nil in strend git-svn-id: trunk@34493 - --- rtl/inc/genstr.inc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rtl/inc/genstr.inc b/rtl/inc/genstr.inc index 54f96b8f65..2ce7eedbe6 100644 --- a/rtl/inc/genstr.inc +++ b/rtl/inc/genstr.inc @@ -18,9 +18,14 @@ counter: SizeInt; begin counter := 0; - while P[counter] <> #0 do - Inc(counter); - StrEnd := @(P[Counter]); + if not Assigned(P) then + StrEnd:=Nil + else + begin + while P[counter] <> #0 do + Inc(counter); + StrEnd := @(P[Counter]); + end; end; {$endif FPC_UNIT_HAS_STREND}