Skip to content

BugFix: correct mis-use of nullptr to denote no room symbol colour#4679

Merged
SlySven merged 1 commit intoMudlet:developmentfrom
SlySven:BugFix_correctMisuseOf_nullptr_toDenoteNoRoomSymbolColour
Jan 25, 2021
Merged

BugFix: correct mis-use of nullptr to denote no room symbol colour#4679
SlySven merged 1 commit intoMudlet:developmentfrom
SlySven:BugFix_correctMisuseOf_nullptr_toDenoteNoRoomSymbolColour

Conversation

@SlySven
Copy link
Copy Markdown
Member

@SlySven SlySven commented Jan 25, 2021

It seems like PR #4573 introduced a bogus use of pointer access to a QColor whereas the correct methodology is QColor::isValid() - a default constructed QColor is itself equivalent to an RGBA specified colour of QColor(0,0,0,0) and that will fail in that test. This PR fixes things so that (instead of a nullptr test) is used.

Signed-off-by: Stephen Lyons slysven@virginmedia.com

It seems like PR Mudlet#4573 introduced a bogus use of pointer access to a
`QColor` whereas the correct methodology is `QColor::isValid()` - a default
constructed `QColor` is itself equivalent to an RGBA specified colour of
`QColor(0,0,0,0)` and that will fail in that test. This PR fixes things so
that (instead of a `nullptr` test) is used.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@SlySven SlySven requested a review from a team as a code owner January 25, 2021 10:50
@SlySven SlySven requested review from a team January 25, 2021 10:50
@add-deployment-links
Copy link
Copy Markdown

add-deployment-links bot commented Jan 25, 2021

Hey there! Thanks for helping Mudlet improve. 🌟

Test versions

You can directly test the changes here:

No need to install anything - just unzip and run.
Let us know if it works well, and if it doesn't, please give details.

@SlySven
Copy link
Copy Markdown
Member Author

SlySven commented Jan 25, 2021

I am ranking this as a medium priority bugfix (without there being an explicit bug issue relating to it). OTOH if this is the underlying reason for any inexplicable crashes related to the map - it might be more important than that..!

@SlySven SlySven merged commit 5dee468 into Mudlet:development Jan 25, 2021
@SlySven SlySven deleted the BugFix_correctMisuseOf_nullptr_toDenoteNoRoomSymbolColour branch January 25, 2021 11:26
Chris7 pushed a commit to Chris7/Mudlet that referenced this pull request Jan 2, 2022
…udlet#4679)

It seems like PR Mudlet#4573 introduced a bogus use of pointer access to a
`QColor` whereas the correct methodology is `QColor::isValid()` - a default
constructed `QColor` is itself equivalent to an RGBA specified colour of
`QColor(0,0,0,0)` and that will fail in that test. This PR fixes things so
that (instead of a `nullptr` test) is used.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants