yl_statuseffects/tipsy/init.lua:116: table index is nil #4532

Closed
opened 2023-05-18 20:12:38 +00:00 by AliasAlreadyTaken · 5 comments

2023-05-18 20:10:53: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'yl_statuseffects' in callback on_chat_message(): ...inetest_live/bin/../mods/yl_statuseffects/tipsy/init.lua:116: table index is nil
2023-05-18 20:10:53: ERROR[Main]: stack traceback:
2023-05-18 20:10:53: ERROR[Main]: ...inetest_live/bin/../mods/yl_statuseffects/tipsy/init.lua:116: in function 'func'
2023-05-18 20:10:53: ERROR[Main]: ...inetest_live/bin/../builtin/profiler/instrumentation.lua:107: in function 'func'
2023-05-18 20:10:53: ERROR[Main]: /home/mt/5.6.1/Minetest_live/bin/../builtin/game/chat.lua:79: in function </home/mt/5.6.1/Minetest_live/bin/../builtin/game/chat.lua:52>
2023-05-18 20:10:53: 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-05-18 20:10:53: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'yl_statuseffects' in callback on_chat_message(): ...inetest_live/bin/../mods/yl_statuseffects/tipsy/init.lua:116: table index is nil 2023-05-18 20:10:53: ERROR[Main]: stack traceback: 2023-05-18 20:10:53: ERROR[Main]: ...inetest_live/bin/../mods/yl_statuseffects/tipsy/init.lua:116: in function 'func' 2023-05-18 20:10:53: ERROR[Main]: ...inetest_live/bin/../builtin/profiler/instrumentation.lua:107: in function 'func' 2023-05-18 20:10:53: ERROR[Main]: /home/mt/5.6.1/Minetest_live/bin/../builtin/game/chat.lua:79: in function </home/mt/5.6.1/Minetest_live/bin/../builtin/game/chat.lua:52> 2023-05-18 20:10:53: 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>
flux added the
1. kind/bug
2. prio/critical
4. step/ready to QA test
labels 2023-05-18 20:13:41 +00:00
Member

i made a logic booboo, fixed in c218c40319

repro is running "/set_tipsy" with no arguments.

i made a logic booboo, fixed in https://gitea.your-land.de/your-land/yl_statuseffects/commit/c218c4031908bd9f26d9d914e411265abf55c91a repro is running "/set_tipsy" with no arguments.
Author
Owner
if not target and amount then
        return false, "usage: /set_tipsy <target> <amount>"
end
if amount == 0 then
        yl_statuseffects.tipsiness[target] = nil

else
        yl_statuseffects.tipsiness[target] = amount -- <= line 116
end

dumbfix =>

if not (target or amount) then
        return false, "usage: /set_tipsy <target> <amount>"
end
if amount == 0 then
        yl_statuseffects.tipsiness[target] = nil

else
        yl_statuseffects.tipsiness[target] = amount
end
```lua if not target and amount then return false, "usage: /set_tipsy <target> <amount>" end if amount == 0 then yl_statuseffects.tipsiness[target] = nil else yl_statuseffects.tipsiness[target] = amount -- <= line 116 end ``` dumbfix => ```lua if not (target or amount) then return false, "usage: /set_tipsy <target> <amount>" end if amount == 0 then yl_statuseffects.tipsiness[target] = nil else yl_statuseffects.tipsiness[target] = amount end ```
Author
Owner

i made a logic booboo, fixed in c218c40319

See, I didn't get it right in the dumbfix as well :P

> i made a logic booboo, fixed in https://gitea.your-land.de/your-land/yl_statuseffects/commit/c218c4031908bd9f26d9d914e411265abf55c91a See, I didn't get it right in the dumbfix as well :P
AliasAlreadyTaken added this to the 1.1.120 milestone 2023-05-18 20:38:25 +00:00
Member

i made a logic booboo, fixed in c218c40319

See, I didn't get it right in the dumbfix as well :P

while the dumbfix wasn't as "correct", it wasn't likely to cause a crash in practice, because not target implies not amount w/ the given code, outside of serious shenanigans like re-writing string methods.

> > i made a logic booboo, fixed in https://gitea.your-land.de/your-land/yl_statuseffects/commit/c218c4031908bd9f26d9d914e411265abf55c91a > > See, I didn't get it right in the dumbfix as well :P while the dumbfix wasn't as "correct", it wasn't likely to cause a crash in practice, because `not target` implies `not amount` w/ the given code, outside of serious shenanigans like re-writing string methods.
AliasAlreadyTaken added the
ugh/QA OK
label 2023-08-26 11:45:33 +00:00
flux added
5. result/fixed
and removed
4. step/ready to QA test
labels 2023-11-16 21:45:31 +00:00
Member

this is live

this is live
flux closed this issue 2023-11-16 21:45:37 +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#4532
No description provided.