Fix some bug:
Avoid dismiss dialog already dismissed Avoid access to invalid index when have no server
This commit is contained in:
parent
5f0b439e21
commit
a6934bccb8
1 changed files with 2 additions and 2 deletions
|
@ -283,7 +283,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(progressDialog != null) {
|
||||
if(progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
progressDialog = null;
|
||||
}
|
||||
|
@ -522,7 +522,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||
//what server we use
|
||||
Spinner urlSpinner = (Spinner)findViewById(R.id.servers_spinner);
|
||||
int pos = urlSpinner.getSelectedItemPosition();
|
||||
if(urls.size() < pos) {
|
||||
if(urls.size() < pos || pos == Spinner.INVALID_POSITION) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
|
Loading…
Reference in a new issue