Commit a6934bcc authored by Schoumi's avatar Schoumi

Fix some bug:

Avoid dismiss dialog already dismissed
Avoid access to invalid index when have no server
parent 5f0b439e
......@@ -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() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment