MBS-7696: Make buildOptionsTree work for empty trees
Ulrich Klauer
Branch: chirlu/musicbrainz-server:mbs-7696
chirlu/musicbrainz-server:mbs-7696
Branch: metabrainz/musicbrainz-server:beta
metabrainz/musicbrainz-server:beta
Merged
#1060 · Created  · Last updated
Description
The buildOptionsTree function failed with a type error if the root element had no children, because "children" was treated as an array without prior checking for definedness.
It’s not sure this really fixes MBS-7696 because the issue is not easily reproducible – I suspect some kind of race condition. However, it fixes some bug in any case, because the function should be able to deal with empty trees.
The
buildOptionsTree
function failed with a type error if the root element had no children, because "children" was treated as an array without prior checking for definedness.It’s not sure this really fixes MBS-7696 because the issue is not easily reproducible – I suspect some kind of race condition. However, it fixes some bug in any case, because the function should be able to deal with empty trees.