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

Make sure app does not crash when webirc is not defined in the configuration #294

Merged
merged 1 commit into from
May 2, 2016

Conversation

astorije
Copy link
Member

@astorije astorije commented May 2, 2016

The check currently tests against null. When the configuration file does not even have webirc, its value is undefined, not null:

/home/dusk/lounge/src/client.js:175
        if (config.webirc !== null && network.host in config.webirc) {
                                                            ^

TypeError: Cannot use 'in' operator to search for 'ocelot.link' in undefined
    at Client.connect ([...]/lounge/src/client.js:175:54)
    at Timeout._onTimeout ([...]/lounge/src/client.js:73:12)
    at tryOnTimeout (timers.js:224:11)
    at Timer.listOnTimeout (timers.js:198:5)

This PR also ensures smoother upgrades: when upgrading, if admins do not set webirc to null or something, it will just refuse to run.

@astorije astorije added the Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors. label May 2, 2016
@maxpoulin64 maxpoulin64 merged commit a3c1127 into master May 2, 2016
@maxpoulin64 maxpoulin64 deleted the astorije/fix-webirc-config branch May 2, 2016 05:15
@astorije astorije added this to the ★ Next Release milestone May 15, 2016
matburnham pushed a commit to matburnham/lounge that referenced this pull request Sep 6, 2017
…onfig

Make sure app does not crash when webirc is not defined in the configuration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants