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