fabulous-dev / Fabulous

Declarative UI framework for cross-platform mobile & desktop apps, using MVU and F# functional programming
https://fabulous.dev
Apache License 2.0
1.13k stars 122 forks source link

Fix NullReferenceException when dispatching Mounted event #952

Closed TimLariviere closed 2 years ago

TimLariviere commented 2 years ago

When dispatching a message to the children of a node (e.g. Mounted event), we were incorrectly enumerating the WidgetCollection ArraySlice.

The ArraySlice allocates 4 uninitialized items and has a size property to let us know how many items are actually initialized.

Except here we were enumerating all items including those uninitialized leading to a Null Reference Exception