awslabs / aws-mobile-appsync-sdk-js

JavaScript library files for Offline, Sync, Sigv4. includes support for React Native
Apache License 2.0
917 stars 265 forks source link

Cannot read property 'error' of null in realtime-subsription-handshake-link.js #688

Open simonbuerger opened 2 years ago

simonbuerger commented 2 years ago

Seems to happen after leaving app open for an extended period (eg in simulator, but I have seen it on device too) and observer is set to null when it tries to call observer.error

Think it might be this line, but I noticed there's no null check on any of the observer.error calls https://github.com/awslabs/aws-mobile-appsync-sdk-js/blob/f5c6e1a1be0bfa43fce5615deefe3a8777374268/packages/aws-appsync-subscription-link/src/realtime-subscription-handshake-link.ts#L722

Can I open a PR and add null checks for the observer.error calls?