diff --git a/app/sagas/selectServer.js b/app/sagas/selectServer.js index 04e851fa..e42719c5 100644 --- a/app/sagas/selectServer.js +++ b/app/sagas/selectServer.js @@ -86,14 +86,15 @@ const handleServerRequest = function* handleServerRequest({ server, certificate const serverInfo = yield getServerInfo({ server }); - const loginServicesLength = yield RocketChat.getLoginServices(server); - if (loginServicesLength === 0) { - Navigation.navigate('LoginView'); - } else { - Navigation.navigate('LoginSignupView'); + if (serverInfo) { + const loginServicesLength = yield RocketChat.getLoginServices(server); + if (loginServicesLength === 0) { + Navigation.navigate('LoginView'); + } else { + Navigation.navigate('LoginSignupView'); + } + yield put(selectServerRequest(server, serverInfo.version, false)); } - - yield put(selectServerRequest(server, serverInfo.version, false)); } catch (e) { yield put(serverFailure()); log(e); diff --git a/app/views/NewServerView.js b/app/views/NewServerView.js index 5d03cb0e..c7050041 100644 --- a/app/views/NewServerView.js +++ b/app/views/NewServerView.js @@ -134,8 +134,8 @@ class NewServerView extends React.Component { const certificatePath = `${ FileSystem.documentDirectory }/${ certificate.name }`; try { await FileSystem.copyAsync({ from: certificate.path, to: certificatePath }); - } catch (error) { - log('err_save_certificate', error); + } catch (e) { + log(e); } cert = { path: this.uriToPath(certificatePath), // file:// isn't allowed by obj-C @@ -166,9 +166,9 @@ class NewServerView extends React.Component { ], 'secure-text', ); - } catch (error) { - if (!DocumentPicker.isCancel(error)) { - log('err_choose_certificate', error); + } catch (e) { + if (!DocumentPicker.isCancel(e)) { + log(e); } } }