Closed mdbs99 closed 7 years ago
I've renamed some classes and forgot to change these names in template.xml
.
Because that I got an Access Violation (AV).
Look the code:
Node :=
Template
.Document
.DocumentElement
.FindNode(Self.ClassName)
.FindNode('files')
.ChildNodes
.Item[0];
If FindNode(Self.ClassName)
returns NULL we will get an AV.
So, is very important to throw away all NULL from our softwares.
It
TXMLComponent
class works with default XML libs in FPC/Lazarus. It creates aTXMLDocument
. Sometimes (many times) its methods likeFindNode
,ChildNodes
, orItem
find nothing and the code receives a NULL. The NULL is a anti-pattern as I already said here.Is it possible creates decorators for these objects (
TDOMNode
, for exemple)?