fixed some access violations from Matthijs Willemstein

git-svn-id: trunk@7110 -
This commit is contained in:
vincents 2005-04-27 14:39:12 +00:00
parent cca55bdadb
commit 553b2f9e2a

View File

@ -195,8 +195,13 @@ end;
procedure TCustomPackageEditor.SetCurrentModule(Value: TDomElement); procedure TCustomPackageEditor.SetCurrentModule(Value: TDomElement);
begin begin
CurrentPackage:=Value.ParentNode as TDomElement; //matthijs 10-4-2005 19:16 added checks on Value and Value.ParentNode
FCurrentModule:=Value; if (Value <> nil) then begin
if (Value.ParentNode <> nil) then begin
CurrentPackage:=Value.ParentNode as TDomElement;
FCurrentModule:=Value;
end;
end;
end; end;
procedure TCustomPackageEditor.SetCurrentPackage(Value: TDomElement); procedure TCustomPackageEditor.SetCurrentPackage(Value: TDomElement);
@ -851,7 +856,7 @@ begin
Raise Exception.CreateFmt(SErrNoNodeForTopic,[M['name']]); Raise Exception.CreateFmt(SErrNoNodeForTopic,[M['name']]);
end; end;
Function TPackageEditor.FindElementNode(E : TDomElement; N : TTreeNode) : TTreeNode; Function TPackageEditor.FindElementNode(E: TDomElement; N: TTreeNode): TTreeNode;
Var Var
P : TTreeNode; P : TTreeNode;
@ -868,8 +873,9 @@ begin
P:=FModuleNode; P:=FModuleNode;
Result:=SubNodeWithElement(P,E); Result:=SubNodeWithElement(P,E);
end; end;
If (Result=Nil) then //matthijs 10-4-2005 19:22 Made next two lines comments.
Raise Exception.CreateFmt(SErrNoNodeForElement,[E['name']]); // If (Result=Nil) then
// Raise Exception.CreateFmt(SErrNoNodeForElement,[E['name']]);
end; end;
Procedure TPackageEditor.AddElement(E : TDomElement); Procedure TPackageEditor.AddElement(E : TDomElement);
@ -963,7 +969,8 @@ end;
Procedure TPackageEditor.SetCurrentElement(E : TDomElement); Procedure TPackageEditor.SetCurrentElement(E : TDomElement);
begin begin
If (E<>FCurrentElement) then //matthijs 10-4-2005 19:27 Added Check on E = nil.
If (E<>FCurrentElement) and (E <> nil) then
begin begin
Inherited; Inherited;
CurrentModule:=E.ParentNode as TDomElement; CurrentModule:=E.ParentNode as TDomElement;