Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release condition around assert in ShellMenuSchemeManager::Parse #1082

Open
xezon opened this issue Feb 4, 2024 · 0 comments
Open

Release condition around assert in ShellMenuSchemeManager::Parse #1082

xezon opened this issue Feb 4, 2024 · 0 comments

Comments

@xezon
Copy link
Contributor

xezon commented Feb 4, 2024

void ShellMenuSchemeManager::Parse(INI *ini)
{
    Utf8String name;
    name.Set(ini->Get_Next_Token());
    ShellMenuSchemeManager *manager = g_theShell->Get_Menu_Scheme_Manager();

    if (manager == nullptr) {
        captainslog_dbgassert(false, "ShellMenuSchemeManager::Parse: Unable to Get SMSchemeManager");
    }

    if (manager != nullptr) {
        ShellMenuScheme *scheme = manager->New_Shell_Menu_Scheme(name);
        captainslog_dbgassert(
            scheme != nullptr, "ShellMenuSchemeManager::Parse: Unable to allocate Scheme '%s'", name.Str());
        ini->Init_From_INI(scheme, ShellMenuSchemeManager::Get_Field_Parse());
    }
}

Should become

captainslog_dbgassert(manager != nullptr, "ShellMenuSchemeManager::Parse: Unable to Get SMSchemeManager");

so it can definitely compile out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant