azlyth / react-native-ssh

a library that enables React Native apps to execute commands over SSH -
https://ptrvldz.me/react-native-ssh/
71 stars 15 forks source link

Fix segfault when can't connect #6

Closed traviswsims closed 6 years ago

traviswsims commented 6 years ago

On iOS, if the client can't connect to a server (e.g., server isn't found) the app will crash because we're attempting to operate on a non-existent session, which causes a segfault.

To prevent, I've rejected the promise when we can't connect.

I'm also using the library on RN 0.40.0, and it works great, so I updated the peer dependency to 0.x.x. Otherwise, I can't use the library because of 0.35.0 restriction.

Thanks!

azlyth commented 6 years ago

Looks good to me. I haven't tested it, but if it works for you, good enough!

And I agree with the 0.x.x peer dependency version. We'll see what happens when a major version comes around one day.