Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MoreMesecons/moremesecons_entity_detector/init.lua:68: bad argument #2 to 'set_string' (string expected, got table) #38

Open
Bastrabun opened this issue Nov 29, 2024 · 0 comments · May be fixed by #39

Comments

@Bastrabun
Copy link

Bastrabun commented Nov 29, 2024

Repro:

Have mesecons, digilines, moremesecons

  1. Place mesecons_luacontroller:luacontroller
  2. Place moremesecons_entity_detector:entity_detector
  3. Add channel "kaputt" to entity_detector
  4. Add code to luacontroller: digiline_send("kaputt",{})
  5. Press Execute

Crash

AsyncErr: Lua: Runtime error from mod 'mesecons' in callback environment_Step(): .../mods/moremesecons/moremesecons_entity_detector/init.lua:68: bad argument #2 to 'set_string' (string expected, got table)
stack traceback:
	[C]: in function 'set_string'
	.../mods/moremesecons/moremesecons_entity_detector/init.lua:68: in function 'action'
	.../5.10.0/minetest-temp/bin/../mods/digilines/internal.lua:106: in function 'transmit'
	...test/5.10.0/minetest-temp/bin/../mods/digilines/init.lua:60: in function 'receptor_send'
	...emp/bin/../mods/mesecons/mesecons_luacontroller/init.lua:752: in function <...emp/bin/../mods/mesecons/mesecons_luacontroller/init.lua:746>
	...etest-temp/bin/../mods/mesecons/mesecons/actionqueue.lua:131: in function 'execute'
	...etest-temp/bin/../mods/mesecons/mesecons/actionqueue.lua:121: in function <...etest-temp/bin/../mods/mesecons/mesecons/actionqueue.lua:76>
	.../5.10.0/minetest-temp/bin/../builtin/common/register.lua:26: in function <.../5.10.0/minetest-temp/bin/../builtin/common/register.lua:12>

This doesn't happen in 5.8.0, only in 5.9.1 and 5.10.0 and 5.11.0-dev

The difference is in handling of incorrect arguments in case of meta:set_string("key", {}) - it silently unsets the key on 5.8 and errors on 5.9+

Please add a type check

Similar minetest-mods/mesecons#691

For my reference 7743

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant