mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 15:15:51 +03:00
Merge pull request #12587 from nextcloud/fixAuthNPE
On branded clients NPE can occur
This commit is contained in:
commit
639a7b9f53
1 changed files with 6 additions and 6 deletions
|
@ -60,7 +60,6 @@ import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.text.Editable;
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.AndroidRuntimeException;
|
import android.util.AndroidRuntimeException;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
@ -215,7 +214,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||||
private AccountManager mAccountMgr;
|
private AccountManager mAccountMgr;
|
||||||
|
|
||||||
/// Server PRE-Fragment elements
|
/// Server PRE-Fragment elements
|
||||||
private AccountSetupBinding accountSetupBinding;
|
private AccountSetupBinding accountSetupBinding = null;
|
||||||
private AccountSetupWebviewBinding accountSetupWebviewBinding;
|
private AccountSetupWebviewBinding accountSetupWebviewBinding;
|
||||||
|
|
||||||
private String mServerStatusText = EMPTY_STRING;
|
private String mServerStatusText = EMPTY_STRING;
|
||||||
|
@ -768,13 +767,14 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@SuppressFBWarnings("NP")
|
||||||
private void checkOcServer() {
|
private void checkOcServer() {
|
||||||
String uri;
|
String uri;
|
||||||
Editable hostUrlInput = accountSetupBinding.hostUrlInput.getText();
|
|
||||||
|
|
||||||
if (accountSetupBinding != null && hostUrlInput != null &&
|
if (accountSetupBinding != null &&
|
||||||
!hostUrlInput.toString().isEmpty()) {
|
accountSetupBinding.hostUrlInput.getText() != null &&
|
||||||
uri = hostUrlInput.toString().trim();
|
!accountSetupBinding.hostUrlInput.getText().toString().isEmpty()) {
|
||||||
|
uri = accountSetupBinding.hostUrlInput.getText().toString().trim();
|
||||||
} else {
|
} else {
|
||||||
uri = mServerInfo.mBaseUrl;
|
uri = mServerInfo.mBaseUrl;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue