Skip to content

BugFix: prevent addCustomLine from crashing without custom line points#5286

Merged
SlySven merged 2 commits intoMudlet:developmentfrom
SlySven:BugFix_preventCrashWithNoCustomLinePointsIn_addCustomLine
Jul 31, 2021
Merged

BugFix: prevent addCustomLine from crashing without custom line points#5286
SlySven merged 2 commits intoMudlet:developmentfrom
SlySven:BugFix_preventCrashWithNoCustomLinePointsIn_addCustomLine

Conversation

@SlySven
Copy link
Copy Markdown
Member

@SlySven SlySven commented Jun 13, 2021

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:

  • 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 ints to (32-bit) ints.
  • 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

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>
@SlySven SlySven added this to the 4.13.0 milestone Jun 13, 2021
@SlySven SlySven requested a review from a team as a code owner June 13, 2021 14:34
@SlySven SlySven requested review from a team June 13, 2021 14:34
@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@keneanung
Copy link
Copy Markdown
Member

/create links

@add-deployment-links
Copy link
Copy Markdown

add-deployment-links bot commented Jun 17, 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.

Copy link
Copy Markdown
Member

@keneanung keneanung left a comment

Choose a reason for hiding this comment

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

lgtm

@Kebap Kebap changed the title BugFix: prevent crash with no custom line points in addCustomLine BugFix: prevent addCustomLine from crashing without custom line points Jun 25, 2021
@vadi2 vadi2 assigned SlySven and unassigned vadi2 Jul 31, 2021
Popular opinion seems to say the the error message was too much information...

Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>
@SlySven SlySven merged commit 00d9d8e into Mudlet:development Jul 31, 2021
@SlySven SlySven deleted the BugFix_preventCrashWithNoCustomLinePointsIn_addCustomLine branch July 31, 2021 21:20
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.

3 participants