Skip to content

Commit

Permalink
Added nul check to API removeToken for #367
Browse files Browse the repository at this point in the history
  • Loading branch information
dalezak committed Jan 24, 2019
1 parent a5a5196 commit 54f6975
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/providers/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,17 @@ export class ApiProvider extends HttpProvider {

public removeToken(organization:Organization):Promise<boolean> {
return new Promise((resolve, reject) => {
this.storage.remove(organization.subdomain).then((removed:any) => {
resolve(true);
},
(error:any) => {
if (organization) {
this.storage.remove(organization.subdomain).then((removed:any) => {
resolve(true);
},
(error:any) => {
resolve(false);
});
}
else {
resolve(false);
});
}
});
}

Expand Down

0 comments on commit 54f6975

Please sign in to comment.