From d028fcba64dab20674fbb124ecb8b204b74e2135 Mon Sep 17 00:00:00 2001 From: inoussa Date: Mon, 16 Nov 2009 09:25:37 +0000 Subject: [PATCH] Check the parent context ( for not nil ) before using it : avoid an AV exception. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1011 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- wst/trunk/ws_helper/xsd_parser.pas | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wst/trunk/ws_helper/xsd_parser.pas b/wst/trunk/ws_helper/xsd_parser.pas index 8ef319e93..aa24d9349 100644 --- a/wst/trunk/ws_helper/xsd_parser.pas +++ b/wst/trunk/ws_helper/xsd_parser.pas @@ -247,6 +247,7 @@ function TCustomXsdSchemaParser.FindNameSpace( var i : PtrInt; ls : TStrings; + pc : IParserContext; begin AResult := ''; Result := False; @@ -258,8 +259,11 @@ begin Break; end; end; - if not Result then - Result := GetParentContext().FindNameSpace(AShortName,AResult); + if not Result then begin + pc := GetParentContext(); + if ( pc <> nil ) then + Result := GetParentContext().FindNameSpace(AShortName,AResult); + end; end; function TCustomXsdSchemaParser.FindShortNamesForNameSpace(const ANameSpace: string): TStrings;