Fix issue with fileExists always returning false

This commit is contained in:
misaochan 2016-12-14 17:11:55 +13:00
parent c1e764e7c7
commit 06e58b57b8

View file

@ -50,18 +50,17 @@ public class ExistingFileAsync extends AsyncTask<Void, Void, Boolean> {
return false; return false;
} }
ArrayList<ApiResult> resultNodes = result.getNodes("/api/query/allimages/"); ArrayList<ApiResult> resultNodes = result.getNodes("/api/query/allimages/img");
Log.d(TAG, "Result nodes: " + resultNodes); Log.d(TAG, "Result nodes: " + resultNodes);
boolean fileExists; boolean fileExists;
if (resultNodes!=null) { if (!resultNodes.isEmpty()) {
fileExists = true; fileExists = true;
} else { } else {
fileExists = false; 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;