Null scope in effects group
Moderator: Committer
Null scope in effects group
EffectsGroup class checks if m_scope could be nullptr everywhere except Dump function. I've tried to put exception to constructor if scope will be nullptr but it didn't catch anything. Should we even have nullptr checks for it?
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-04-14.ad50e93.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-04-14.ad50e93.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Null scope in effects group
The Boost parser requires scope = ... to be specified, or else will fail to parse, so that's probably why there are no cases where it's not defined by the time it constructs the EffectsGroup object. This requirement should be kept, but it would make sense to do it in the constructor and then skip the checks everywhere else.