heroiclabs / nakama-defold

Defold client for Nakama server.
https://heroiclabs.com
Apache License 2.0
74 stars 12 forks source link

3.0.0: nakama/socket.lua:18: attempt to call global 'log' (a nil value) #43

Closed logicalparadox closed 2 years ago

logicalparadox commented 2 years ago

Reproduce by receiving a socket event that does not have a bound listener.

ERROR:SCRIPT: nakama/socket.lua:18: attempt to call global 'log' (a nil value)
stack traceback:
  nakama/socket.lua:18: in function on_message
  nakama/engine/defold.lua:122: in function on_message
  nakama/engine/defold.lua:164: in function <nakama/engine/defold.lua:152>
britzl commented 2 years ago

Thank you for the report @logicalparadox. And sorry about this. I encountered this problem myself and by accident made the fix in the generated code instead of in the template. And the fix got overwritten when the code was generated next time.

In the coming weeks I'll add unit tests to catch issues such as this one.