Skip to content

Commit 6e8b430

Browse files
committed
Fix null pointer access when iterating over empty arrays.
The PropTable.table field is a RandAA, which is a class and thus does not exhibit the more forgiving interface as built-in AAs.
1 parent 14a9547 commit 6e8b430

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

engine/source/dmdscript/iterator.d

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ struct Iterator
7070
ostart = o;
7171
this.o = o;
7272
this.callcontext = cc;
73-
keys = o.proptable.table.keys.sort!((a, b) => a.compare(cc, b) < 0).release;
73+
if (o.proptable.table)
74+
keys = o.proptable.table.keys.sort!((a, b) => a.compare(cc, b) < 0).release;
7475
keyindex = 0;
7576
}
7677

0 commit comments

Comments
 (0)