fix crash auth without internet connection;

fix other crash;
This commit is contained in:
Skalii 2021-01-06 18:23:59 +02:00
parent 1b3961753f
commit 8d930b508a
2 changed files with 10 additions and 2 deletions

View file

@ -138,7 +138,11 @@ public class OsmOAuthAuthorizationAdapter {
@Override @Override
protected void onPostExecute(@NonNull OAuth1RequestToken requestToken) { protected void onPostExecute(@NonNull OAuth1RequestToken requestToken) {
loadWebView(rootLayout, nightMode, client.getService().getAuthorizationUrl(requestToken)); if (requestToken != null) {
loadWebView(rootLayout, nightMode, client.getService().getAuthorizationUrl(requestToken));
} else {
app.showShortToastMessage(app.getString(R.string.internet_not_available));
}
} }
} }

View file

@ -45,7 +45,11 @@ public class OsmOAuthHelper {
} }
public void authorize(@NonNull String oauthVerifier) { public void authorize(@NonNull String oauthVerifier) {
authorizationAdapter.authorize(oauthVerifier, this); if (oauthVerifier != null) {
authorizationAdapter.authorize(oauthVerifier, this);
} else {
updateAdapter();
}
} }
public void resetAuthorization() { public void resetAuthorization() {