fpvectorial: Fixes sigsegv in case of a format declared without either the reader or writer but with the other one

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1592 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2011-04-21 11:44:59 +00:00
parent 2d7451b118
commit faec8229e2

View File

@ -771,7 +771,8 @@ begin
for i := 0 to Length(GvVectorialFormats) - 1 do for i := 0 to Length(GvVectorialFormats) - 1 do
if GvVectorialFormats[i].Format = AFormat then if GvVectorialFormats[i].Format = AFormat then
begin begin
Result := GvVectorialFormats[i].WriterClass.Create; if GvVectorialFormats[i].WriterClass <> nil then
Result := GvVectorialFormats[i].WriterClass.Create;
Break; Break;
end; end;
@ -792,7 +793,8 @@ begin
for i := 0 to Length(GvVectorialFormats) - 1 do for i := 0 to Length(GvVectorialFormats) - 1 do
if GvVectorialFormats[i].Format = AFormat then if GvVectorialFormats[i].Format = AFormat then
begin begin
Result := GvVectorialFormats[i].ReaderClass.Create; if GvVectorialFormats[i].ReaderClass <> nil then
Result := GvVectorialFormats[i].ReaderClass.Create;
Break; Break;
end; end;