mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
if nothing received to upload, app crashed
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
2fe9db5146
commit
c9634022d2
1 changed files with 15 additions and 14 deletions
|
@ -192,22 +192,23 @@ public class ReceiveExternalFilesActivity extends FileActivity
|
|||
|
||||
@Override
|
||||
protected void setAccount(Account account, boolean savedAccount) {
|
||||
if (somethingToUpload()) {
|
||||
mAccountManager = (AccountManager) getSystemService(Context.ACCOUNT_SERVICE);
|
||||
Account[] accounts = mAccountManager.getAccountsByType(MainApp.getAccountType());
|
||||
if (accounts.length == 0) {
|
||||
Log_OC.i(TAG, "No ownCloud account is available");
|
||||
DialogNoAccount dialog = new DialogNoAccount();
|
||||
dialog.show(getSupportFragmentManager(), null);
|
||||
} else {
|
||||
if (!savedAccount) {
|
||||
setAccount(accounts[0]);
|
||||
}
|
||||
}
|
||||
mAccountManager = (AccountManager) getSystemService(Context.ACCOUNT_SERVICE);
|
||||
|
||||
Account[] accounts = mAccountManager.getAccountsByType(MainApp.getAccountType());
|
||||
if (accounts.length == 0) {
|
||||
Log_OC.i(TAG, "No ownCloud account is available");
|
||||
DialogNoAccount dialog = new DialogNoAccount();
|
||||
dialog.show(getSupportFragmentManager(), null);
|
||||
} else {
|
||||
if (!savedAccount) {
|
||||
setAccount(accounts[0]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!somethingToUpload()) {
|
||||
showErrorDialog(
|
||||
R.string.uploader_error_message_no_file_to_upload,
|
||||
R.string.uploader_error_title_no_file_to_upload
|
||||
R.string.uploader_error_message_no_file_to_upload,
|
||||
R.string.uploader_error_title_no_file_to_upload
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue