Skip to content
This repository has been archived by the owner on Jul 3, 2021. It is now read-only.

5.0.0 Crashes on joining the waitlist #139

Closed
mortenn opened this issue Sep 26, 2017 · 5 comments
Closed

5.0.0 Crashes on joining the waitlist #139

mortenn opened this issue Sep 26, 2017 · 5 comments

Comments

@mortenn
Copy link
Contributor

mortenn commented Sep 26, 2017

No description provided.

@mortenn
Copy link
Contributor Author

mortenn commented Sep 26, 2017

/home/kawaiibot/bot.js/node_modules/plugapi/lib/room.js:195
        for (let i = 0; i < ids.length; i++) {
                               ^

TypeError: Cannot read property 'length' of undefined
    at Room.usersToArray (/home/kawaiibot/bot.js/node_modules/plugapi/lib/room.js:195:32)
    at Room.getWaitList (/home/kawaiibot/bot.js/node_modules/plugapi/lib/room.js:701:21)
    at Room.getBoothMeta (/home/kawaiibot/bot.js/node_modules/plugapi/lib/room.js:832:34)
    at PlugAPI.joinBooth (/home/kawaiibot/bot.js/node_modules/plugapi/lib/client.js:1597:137)
    at Object.joinBooth (/home/kawaiibot/bot.js/plugbot.js:24:30)
    at Timeout._onTimeout (/home/kawaiibot/bot.js/bot.js:160:33)
    at ontimeout (timers.js:386:14)
    at tryOnTimeout (timers.js:250:5)
    at Timer.listOnTimeout (timers.js:214:5)
error: Forever detected script exited with code: 1
error: Script restart attempt #5

@mortenn
Copy link
Contributor Author

mortenn commented Sep 26, 2017

usersToArray need to verify that it has been passed an array.

@mortenn mortenn changed the title 5.0.0 Crashes on joining an empty waitlist 5.0.0 Crashes on joining the waitlist Sep 26, 2017
@mortenn
Copy link
Contributor Author

mortenn commented Sep 26, 2017

I am guessing this will not happen if someone is in the waitlist when the bot goes to join, but I have not really verified that.

@mortenn
Copy link
Contributor Author

mortenn commented Sep 26, 2017

As an aside, is it really necessary to get the waitlist as user objects just for the bot to join it? Seems like a lot of unnecessary work..

@thedark1337
Copy link
Member

The reason why plugAPI does things differently from plug's is for convenience. Instead of the end user having to getUser an id, plugAPI handles the event automagically. That was an error on my part to not have a typecheck for if anything was passed in though >.<

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

No branches or pull requests

2 participants