Skip to content

qtFRED crashes when adding subsystem argument before ship is selected in operators using OPF_SUBSYSTEM_OR_NONE #7350

@LuytenFS

Description

@LuytenFS

qtFRED crashes because get_listing_opf_subsystem returns nullptr when the ship argument hasn't been filled in yet, it checks for a valid child node and bails early if none exists. get_listing_opf_subsystem_or_none then calls add_list(nullptr) on that result, and since head.next ends up null, the assert at line 7844 fires.

In other words, qtFRED tries to populate the subsystem dropdown before a ship has been selected as the first argument, finds no ship context to pull subsystems from, and returns null instead of at minimum an empty list causing the assert. The fix would need to be in get_listing_opf_subsystem_or_none to handle the null return gracefully, or in get_listing_opf_subsystem to return an empty list rather than null when no ship is selected.
Here's a video showing how to reproduce the crash:

QTFRED-NULLPTR-CRASH.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn issue from unintended consequencesqtfredA feature or issue related to qtFred.

    Type

    Projects

    Status

    Bugs (Issues)

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions