Add checks for result Nodes and fileExists

This commit is contained in:
misaochan 2016-12-14 16:59:03 +13:00
parent 91c6b3518c
commit c1e764e7c7

View file

@ -51,7 +51,17 @@ public class ExistingFileAsync extends AsyncTask<Void, Void, Boolean> {
} }
ArrayList<ApiResult> resultNodes = result.getNodes("/api/query/allimages/"); ArrayList<ApiResult> resultNodes = result.getNodes("/api/query/allimages/");
boolean fileExists = resultNodes!=null;
Log.d(TAG, "Result nodes: " + resultNodes);
boolean fileExists;
if (resultNodes!=null) {
fileExists = true;
} else {
fileExists = false;
}
//FIXME: This always returns false even when file (and nodes) exists, why?
Log.d(TAG, "File already exists in Commons:" + fileExists); Log.d(TAG, "File already exists in Commons:" + fileExists);
return fileExists; return fileExists;