Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
Fix crash in unsubscribeFromQuery
Browse files Browse the repository at this point in the history
See #255.
  • Loading branch information
glasser committed Oct 11, 2016
1 parent 6baf0fd commit 955eae7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/graphql.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,11 @@ export default function graphql(
}

unsubscribeFromQuery() {
if ((this.querySubscription as Subscription).unsubscribe) {
if (this.querySubscription &&
(this.querySubscription as Subscription).unsubscribe) {
(this.querySubscription as Subscription).unsubscribe();
delete this.queryObservable;
delete this.querySubscription;
}
}

Expand Down

0 comments on commit 955eae7

Please sign in to comment.