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

Fix crash in public mode introduced by #370 #413

Merged
merged 1 commit into from
Jun 19, 2016

Conversation

maxpoulin64
Copy link
Member

Oopsie. Just ran into it by accident.

@maxpoulin64 maxpoulin64 added Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors. second review needed labels Jun 19, 2016
@astorije astorije added this to the 2.0.0 milestone Jun 19, 2016
if (config) {
if (config.token) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the purpose of this PR is to ensure that the config (or client.config depending on where it is used) is not null or undefined so that config.something / client.config.something does not crash the app.

However, why did you move from !client.config.token to, effectively, client.config.token?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, yeah I think I made a mistake there. I need to switch it back to !. It is a problem with config being undefined indeed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@astorije updated.

@astorije astorije self-assigned this Jun 19, 2016
@astorije
Copy link
Member

Follow-up question: in which case(s) can we end up with client.config being undefined or null? You said you ran into this, so I'm curious what led you there.

@maxpoulin64
Copy link
Member Author

config is a user's .json file. In public mode, when a user connects, a temporary anonymous client is made and this one doesn't have a config. No config means no JSON, so no token no saving.

@xPaw xPaw merged commit f0adee1 into thelounge:master Jun 19, 2016
@maxpoulin64 maxpoulin64 deleted the fix-token-crash branch June 19, 2016 08:30
matburnham pushed a commit to matburnham/lounge that referenced this pull request Sep 6, 2017
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.

3 participants