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

[BUG][GUI] Fix wallet crashing on faq-buttons press #1895

Merged

Conversation

random-zebra
Copy link

Bug reported today on discord.
Wallet (GUI 4.3.0) crashes when the FAQ buttons from the masternode widget are pressed.

Cause:
The FAQs sections have been recently reduced to only 6 (old zerocoin sections have been removed).
But the buttons in the masternode widget still reference the old indexes (9 and 10), which are now out of bounds.
Further, the safety check inside setSection, still has the old (10) max value hardcoded, so does not prevent this.

Fix:
This clearly shows the difficulty in maintaining code with fixed magic numbers (which depend on a list of objects that may be modified in future releases).
So, let's introduce a proper enumeration inside SettingsFaqWidget, and use that to manage the sections, instead of just integers.

Some section was removed, but the safe-check in setSection and some
button connection were not updated.

Introduce SettingsFaqWidget::Section enumeration and replace bare
integers to define FAQs sections.
@random-zebra random-zebra added GUI Bug Needs Backport Placeholder tag for anything needing a backport to prior version branches labels Oct 3, 2020
@random-zebra random-zebra added this to the 5.0.0 milestone Oct 3, 2020
@random-zebra random-zebra self-assigned this Oct 3, 2020
Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 8b8e706

Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code ACK 8b8e706

@random-zebra random-zebra merged commit a418e9f into PIVX-Project:master Oct 5, 2020
@random-zebra random-zebra removed the Needs Backport Placeholder tag for anything needing a backport to prior version branches label Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants