sdl2: Happiness dialog crash in a ruleset without EFT_CONTENT buildings
That code is broken in general.
First it gets a list of effects of certain type (e.g. "Make Content") active on the city. So far all good. But then when it iterates over that list, it looks for the effect type of each. That's of course always the very type that was the criteria for constructing the list. Then it looks what would be the first building in the ruleset, not necessarily even present in the city, to provide such an effect. End result is that if ruleset has buildigs a, b, c, and d providing "Make Content" effect and the city has built b, c, and d, the code would draw three times icon of a.
Will push S3_0 version to S2_6 too. It didn't apply to sdl-client, and porting seemed too much work for a deprecated client of an officially EOL branch.
Looking at clang analyzer warning.
sdl2-client redraw_happiness_city_dialog() has "surf = NULL;" until it finds a building providing EFT_MAKE_CONTENT effect. If there's no such a building, surf will still be NULL at: "dest.x = city_window->size.x + adj_size(187) - surf->w - adj_size(2);"