Fix some bug:

Avoid dismiss dialog already dismissed
Avoid access to invalid index when have no server
pull/1/head
Schoumi 5 years ago
parent 5f0b439e21
commit a6934bccb8
  1. 4
      app/src/main/java/fr/mobdev/goblim/activity/UploadActivity.java

@ -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