fix crash auth without internet connection;
fix other crash;
This commit is contained in:
parent
1b3961753f
commit
8d930b508a
2 changed files with 10 additions and 2 deletions
|
@ -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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
Loading…
Reference in a new issue