I can reproduce the crash using the attached duplicateKeyNull.zip (which I took the liberty of renaming) by re-enabling the option.
The crash does not happen on this branch.
(I'm still a little concerned that I have no theory for why the crash happens in this particular situation; looking at the code it's obvious that a crash can sometimes happen, but it seems like the crash should only happen when there's a fleet with multiple ships that lack ShipViews, whereas it seems like all the visible ships here should have ShipViews. Hrm.)
AI may duplicate design, which caused the crash... I fixed it by keeping the first, then I read your PR and replaced it with your sum solution! a build is ongoing.
I can reproduce the crash using the attached duplicateKeyNull.zip (which I took the liberty of renaming) by re-enabling the option.
The crash does not happen on this branch.
(I'm still a little concerned that I have no theory for why the crash happens in this particular situation; looking at the code it's obvious that a crash can sometimes happen, but it seems like the crash should only happen when there's a fleet with multiple ships that lack ShipViews, whereas it seems like all the visible ships here should have ShipViews. Hrm.)