BugFix: prevent addCustomLine from crashing without custom line points#5286
Merged
SlySven merged 2 commits intoMudlet:developmentfrom Jul 31, 2021
Conversation
Providing an empty table as the second argument (i.e. without sets of sub-tables as x, y, z coordinates) was causing a fatal crash. This will close issue Mudlet#5272. Also: * fix up some other error messages in the addCustomLine function that referred to the wrong argument index - or didn't mention which one was involved at all. * silence some warnings in the same function caused by casting floating point numbers to integers or down-casting 64-bit `long long int`s to (32-bit) `int`s. * fix handling for the fifth argument NOT being a three-color component (RGB) table - so that it throws a `lua_error(...)` if a table is not provided - previously it was ignoring this defect. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
Member
|
/create links |
|
Hey there! Thanks for helping Mudlet improve. 🌟 Test versionsYou can directly test the changes here:
No need to install anything - just unzip and run. |
vadi2
reviewed
Jun 29, 2021
Popular opinion seems to say the the error message was too much information... Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>
vadi2
approved these changes
Jul 31, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Providing an empty table as the second argument (i.e. without sets of sub-tables as x, y, z coordinates) was causing a fatal crash.
This will close issue #5272.
Also:
long long ints to (32-bit)ints.lua_error(...)if a table is not provided - previously it was ignoring this defect.Signed-off-by: Stephen Lyons slysven@virginmedia.com