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
This commit is contained in:
inoussa
2009-11-16 09:25:37 +00:00
parent 2f31267ad0
commit d028fcba64

View File

@ -247,6 +247,7 @@ function TCustomXsdSchemaParser.FindNameSpace(
var var
i : PtrInt; i : PtrInt;
ls : TStrings; ls : TStrings;
pc : IParserContext;
begin begin
AResult := ''; AResult := '';
Result := False; Result := False;
@ -258,8 +259,11 @@ begin
Break; Break;
end; end;
end; end;
if not Result then if not Result then begin
Result := GetParentContext().FindNameSpace(AShortName,AResult); pc := GetParentContext();
if ( pc <> nil ) then
Result := GetParentContext().FindNameSpace(AShortName,AResult);
end;
end; end;
function TCustomXsdSchemaParser.FindShortNamesForNameSpace(const ANameSpace: string): TStrings; function TCustomXsdSchemaParser.FindShortNamesForNameSpace(const ANameSpace: string): TStrings;