Browse Source

Fix some bug:

Avoid dismiss dialog already dismissed
Avoid access to invalid index when have no server
tags/release-v2.8
Schoumi 2 years ago
parent
commit
a6934bccb8
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      app/src/main/java/fr/mobdev/goblim/activity/UploadActivity.java

+ 2
- 2
app/src/main/java/fr/mobdev/goblim/activity/UploadActivity.java View File

@@ -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…
Cancel
Save