Merge pull request #10536 from osmandapp/fix_crash_oauth_osm
Fix crash OAuth OpenStreetMap
This commit is contained in:
commit
f1bdb378ea
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