Merge pull request #34 from ThibaultNocchi/fix_crash_empty_address_login
Fixed app crash when trying to connect without server address
This commit is contained in:
commit
0c05f27ae0
3 changed files with 10 additions and 0 deletions
|
|
@ -101,6 +101,12 @@ public class LoginActivity extends AbsBaseActivity implements View.OnClickListen
|
|||
|
||||
credentialProvider = new AndroidCredentialProvider(jsonSerializer, this, logger);
|
||||
ConnectionManager connectionManager = App.getConnectionManager(context, jsonSerializer, logger, httpClient);
|
||||
|
||||
if (server.getText().toString().trim().length() == 0) {
|
||||
Toast.makeText(context, context.getResources().getString(R.string.error_login_empty_addr), Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
connectionManager.Connect(server.getText().toString(), new Response<ConnectionResult>() {
|
||||
@Override
|
||||
public void onResponse(ConnectionResult result) {
|
||||
|
|
|
|||
|
|
@ -149,6 +149,8 @@
|
|||
<string name="sort_method_artist">Artiste</string>
|
||||
<string name="sort_method_album">Album</string>
|
||||
<string name="sort_method_year">Année</string>
|
||||
<string name="error_login_empty_addr">Veuillez saisir l\'adresse du serveur.</string>
|
||||
<string name="error_unexpected">Une erreur inattendue s\'est produite.</string>
|
||||
<string name="action_add_to_playlist">Ajouter à une playlist</string>
|
||||
<string name="action_add_to_queue">Ajouter à la liste de lecture</string>
|
||||
<string name="action_clear_queue">Vider la liste de lecture</string>
|
||||
|
|
|
|||
|
|
@ -214,5 +214,7 @@
|
|||
<string name="cancel_current_timer">Cancel current timer</string>
|
||||
<string name="sleep_timer_canceled">Sleep timer canceled.</string>
|
||||
<string name="sleep_timer_set">Sleep timer set for %d minutes from now.</string>
|
||||
<string name="error_login_empty_addr">Please fill in the server address.</string>
|
||||
<string name="error_unexpected">An unexpected error occurred.</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue