From b4d3d6c80a792567d2d36c2016fd079873f4625c Mon Sep 17 00:00:00 2001 From: stom79 Date: Tue, 11 Sep 2018 18:02:31 +0200 Subject: [PATCH] Fix potential crash --- .../gouv/etalab/mastodon/activities/ShowAccountActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/activities/ShowAccountActivity.java b/app/src/main/java/fr/gouv/etalab/mastodon/activities/ShowAccountActivity.java index 79deb6518..826888ac4 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/activities/ShowAccountActivity.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/activities/ShowAccountActivity.java @@ -480,7 +480,10 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt @Override public void onRetrieveAccount(final Account account, Error error) { if( error != null || account.getAcct() == null){ - Toast.makeText(getApplicationContext(), error.getError(),Toast.LENGTH_LONG).show(); + if( error == null) + Toast.makeText(ShowAccountActivity.this, R.string.toast_error,Toast.LENGTH_LONG).show(); + else + Toast.makeText(ShowAccountActivity.this, error.getError(),Toast.LENGTH_LONG).show(); return; } this.account = account;