This code crashes converting Null to integer with emtpy <width/> and <height/> elements:
procedure TSimpleParserRSS.Parse;
...
if ChildNodes.Nodes[Counter].ChildNodes.FindNode(reWidth) <> nil then
FSimpleRSS.Channel.Optional.Image.Optional.Width :=
ChildNodes.Nodes[Counter].ChildNodes.FindNode(reWidth).NodeValue;
if ChildNodes.Nodes[Counter].ChildNodes.FindNode(reHeight) <> nil then
FSimpleRSS.Channel.Optional.Image.Optional.Height :=
ChildNodes.Nodes[Counter].ChildNodes.FindNode(reHeight).NodeValue;
My solution:
procedure TSimpleParserRSS.Parse;
var tVar: OleVariant;
...
if ChildNodes.Nodes[Counter].ChildNodes.FindNode(reWidth) <> nil then
begin
tVar := ChildNodes.Nodes[Counter].ChildNodes.FindNode(reWidth).NodeValue;
if not VarIsNull(tVar)then
FSimpleRSS.Channel.Optional.Image.Optional.Width := tVar;
end;
if ChildNodes.Nodes[Counter].ChildNodes.FindNode(reHeight) <> nil then
begin
tVar := ChildNodes.Nodes[Counter].ChildNodes.FindNode(reHeight).NodeValue;
if not VarIsNull(tVar)then
FSimpleRSS.Channel.Optional.Image.Optional.Height := tVar;
end;