Skip to content

Commit 16e3615

Browse files
committed
V921-007 Check number of items in the list too.
Change-Id: I8908c554ea13a7896d0c63b2b19ec42126c60cb4 (cherry picked from commit 788acc5)
1 parent c2920ca commit 16e3615

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dom/dom-core-nodes.adb

+2-2
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ package body DOM.Core.Nodes is
244244
function First_Child (N : Node) return Node is
245245
List : constant Node_List := Child_Nodes (N);
246246
begin
247-
if List.Items = null then
247+
if List.Items = null or List.Last < 0 then
248248
return null;
249249
else
250250
return List.Items (0);
@@ -258,7 +258,7 @@ package body DOM.Core.Nodes is
258258
function Last_Child (N : Node) return Node is
259259
List : constant Node_List := Child_Nodes (N);
260260
begin
261-
if List.Items = null then
261+
if List.Items = null or List.Last < 0 then
262262
return null;
263263
else
264264
return List.Items (List.Last);

0 commit comments

Comments
 (0)