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

Commit 955eae7

Browse files
committed
Fix crash in unsubscribeFromQuery
See #255.
1 parent 6baf0fd commit 955eae7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/graphql.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,11 @@ export default function graphql(
416416
}
417417

418418
unsubscribeFromQuery() {
419-
if ((this.querySubscription as Subscription).unsubscribe) {
419+
if (this.querySubscription &&
420+
(this.querySubscription as Subscription).unsubscribe) {
420421
(this.querySubscription as Subscription).unsubscribe();
421422
delete this.queryObservable;
423+
delete this.querySubscription;
422424
}
423425
}
424426

0 commit comments

Comments
 (0)