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

Check for nullable result value to avoid errors on unsubscription #4114

Merged
merged 3 commits into from Jul 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion javascript_client/src/subscriptions/ActionCableLink.ts
Expand Up @@ -46,7 +46,7 @@ class ActionCableLink extends ApolloLink {
)
},
received: function(payload) {
if (payload.result.data || payload.result.errors) {
if (payload?.result?.data || payload?.result?.errors) {
Copy link
Owner

Choose a reason for hiding this comment

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

In retrospect, maybe this should have been if (payload.result), do you think that would work in your case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rmosolgo could you run the CI and could we merge this if it's good?

observer.next(payload.result)
}

Expand Down