party/init.lua:338: attempt to concatenate local 'param3' (a nil value) #4064

Closed
opened 2023-03-24 03:07:35 +00:00 by AliasAlreadyTaken · 4 comments

2023-03-24 03:06:10: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'party' in callback on_chat_message(): /home/mt/5.6.1/Minetest_live/bin/../mods/party/init.lua:338: attempt to concatenate local 'param3' (a nil value)
2023-03-24 03:06:10: ERROR[Main]: stack traceback:
2023-03-24 03:06:10: ERROR[Main]: /home/mt/5.6.1/Minetest_live/bin/../mods/party/init.lua:338: in function 'func'
2023-03-24 03:06:10: ERROR[Main]: ...inetest_live/bin/../builtin/profiler/instrumentation.lua:107: in function 'func'
2023-03-24 03:06:10: ERROR[Main]: /home/mt/5.6.1/Minetest_live/bin/../builtin/game/chat.lua:79: in function 'func'
2023-03-24 03:06:10: ERROR[Main]: ...inetest_live/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_live/bin/../builtin/profiler/instrumentation.lua:100>
2023-03-24 03:06:10: ERROR[Main]: .../mt/5.6.1/Minetest_live/bin/../builtin/game/register.lua:431: in function <.../mt/5.6.1/Minetest_live/bin/../builtin/game/register.lua:417>

2023-03-24 03:06:10: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'party' in callback on_chat_message(): /home/mt/5.6.1/Minetest_live/bin/../mods/party/init.lua:338: attempt to concatenate local 'param3' (a nil value) 2023-03-24 03:06:10: ERROR[Main]: stack traceback: 2023-03-24 03:06:10: ERROR[Main]: /home/mt/5.6.1/Minetest_live/bin/../mods/party/init.lua:338: in function 'func' 2023-03-24 03:06:10: ERROR[Main]: ...inetest_live/bin/../builtin/profiler/instrumentation.lua:107: in function 'func' 2023-03-24 03:06:10: ERROR[Main]: /home/mt/5.6.1/Minetest_live/bin/../builtin/game/chat.lua:79: in function 'func' 2023-03-24 03:06:10: ERROR[Main]: ...inetest_live/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_live/bin/../builtin/profiler/instrumentation.lua:100> 2023-03-24 03:06:10: ERROR[Main]: .../mt/5.6.1/Minetest_live/bin/../builtin/game/register.lua:431: in function <.../mt/5.6.1/Minetest_live/bin/../builtin/game/register.lua:417>
AliasAlreadyTaken added the
1. kind/bug
2. prio/critical
labels 2023-03-24 03:10:04 +00:00
Author
Owner

Fixed in 14952d0f61

Fixed in https://gitea.your-land.de/your-land/party/commit/14952d0f61027ba1d5c149eab32fa870bd3464ef
AliasAlreadyTaken added this to the 1.1.118 milestone 2023-03-24 03:45:07 +00:00
AliasAlreadyTaken added the
4. step/ready to QA test
label 2023-03-24 03:45:17 +00:00
Member

@AliasAlreadyTaken looking at the quantity of nil checks i see you add, i feel like you're exhausted w/ how poorly defined the minetest API is. but this check in particular seems totally reasonable.

@AliasAlreadyTaken looking at the quantity of nil checks i see you add, i feel like you're exhausted w/ how poorly defined the minetest API is. but this check in particular seems totally reasonable.
Author
Owner

I don't understand ... ?

Is that a joke because I only added two? :D And because those nil checks are pure lua, they have not much to do with the MT API (which IS poorly designed, documented and censored due to rage.), rather with how the developer of the party mod evaluated the parameters that come from the user of the command.

The first nil check of line 337 avoids the crash - param3 is checked against nil nowhere, while param2 is. We must have been plain lucky noone ever executed the command in this fashion.

The second nil check of line 731 is a mere guess. The developer checks param3 against a string "nil" instead of nil, even though this param3 will hardly ever become string "nil" unless a user really adds "nil" to the /p command as third parameter. I just guessed the developer wanted to check against nil, instead of string "nil".

Or do I misunderstand and I should have done soemthing else instead?

I don't understand ... ? Is that a joke because I only added two? :D And because those nil checks are pure lua, they have not much to do with the MT API (which IS poorly designed, documented and *censored due to rage*.), rather with how the developer of the party mod evaluated the parameters that come from the user of the command. The first nil check of line 337 avoids the crash - param3 is checked against nil nowhere, while param2 is. We must have been plain lucky noone ever executed the command in this fashion. The second nil check of line 731 is a mere guess. The developer checks param3 against a string "nil" instead of nil, even though this param3 will hardly ever become string "nil" unless a user really adds "nil" to the /p command as third parameter. I just guessed the developer wanted to check against nil, instead of string "nil". Or do I misunderstand and I should have done soemthing else instead?
AliasAlreadyTaken added the
ugh/QA main
label 2023-04-13 20:04:15 +00:00
flux added
5. result/fixed
and removed
4. step/ready to QA test
labels 2023-04-26 14:52:34 +00:00
Member

this is live

this is live
flux closed this issue 2023-04-26 14:52:44 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: your-land/bugtracker#4064
No description provided.