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

Segfault when Sidebar has no child #29

Closed
jon-dez opened this issue Jun 20, 2020 · 0 comments
Closed

Segfault when Sidebar has no child #29

jon-dez opened this issue Jun 20, 2020 · 0 comments

Comments

@jon-dez
Copy link
Contributor

jon-dez commented Jun 20, 2020

There is a segfault when borealis tries to render a sidebar with no children.
Unsure if this is intended, but a quick fix is trivial.

// File: library/lib/sidebar.cpp

View* Sidebar::getDefaultFocus()
{

    ...

// Line 43
    View* toFocus{ nullptr };
    if(this->children.size() != 0)
        // Try to focus last focused one
        toFocus = this->children[this->lastFocus]->view->getDefaultFocus();

    ...

}
natinusala pushed a commit that referenced this issue Jun 20, 2020
* Segfault fixed when SideBar has no child.

* Button: Make ButtonStyle::PLAIN the default style; Tab Frame: Fix for not switching to a view if the previous view was nullptr.

* Move the comment above the if statement.
@p-sam p-sam closed this as completed Jun 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants