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

table index is nil #12

Open
subnetmarco opened this issue Nov 11, 2015 · 1 comment
Open

table index is nil #12

subnetmarco opened this issue Nov 11, 2015 · 1 comment

Comments

@subnetmarco
Copy link

When executing this code:

local Mediator = require("mediator")()

Mediator:subscribe("hello", function(data) print(data) end)

I have this issue:

usr/local/share/lua/5.1/mediator.lua:72: table index is nil
stack traceback:
    /usr/local/share/lua/5.1/mediator.lua:72: in function 'addChannel'
    /usr/local/share/lua/5.1/mediator.lua:81: in function 'getChannel'
    /usr/local/share/lua/5.1/mediator.lua:135: in function 'getChannel'
    /usr/local/share/lua/5.1/mediator.lua:142: in function 'subscribe'
    test.lua:3: in main chunk
    [C]: ?

With version 1.1.2-0 installed from LuaRocks.

@subnetmarco
Copy link
Author

So it works when enclosing the channel name into a list, like:

Mediator:subscribe({"hello"}, function(data) print(data) end)

It would be nice if the code could also handle a plain string, because it seems like more intuitive to use.

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

No branches or pull requests

1 participant