Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Add some null checks #1646

Merged
merged 3 commits into from
Dec 5, 2017
Merged

Add some null checks #1646

merged 3 commits into from
Dec 5, 2017

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Dec 5, 2017

No description provided.

src/Lifecycle.js Outdated
@@ -389,7 +389,7 @@ function _persistCredentialsToLocalStorage(credentials) {
* Logs the current session out and transitions to the logged-out state
*/
export function logout() {
if (MatrixClientPeg.get().isGuest()) {
if (MatrixClientPeg.get() && MatrixClientPeg.get().isGuest()) {
Copy link
Member

Choose a reason for hiding this comment

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

errrp this is just going to throw at L405 instead

Copy link
Member Author

Choose a reason for hiding this comment

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

oops, so it will

src/Lifecycle.js Outdated
@@ -389,6 +389,8 @@ function _persistCredentialsToLocalStorage(credentials) {
* Logs the current session out and transitions to the logged-out state
*/
export function logout() {
if (!MatrixClientPeg.get()) return
Copy link
Member

Choose a reason for hiding this comment

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

missing ;

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

lgtm otherwise

@dbkr dbkr merged commit 130c056 into develop Dec 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants