From b59784af890d90ccca1674ea176f9171bd60198b Mon Sep 17 00:00:00 2001 From: "David A. Velasco" Date: Fri, 30 Nov 2012 13:33:23 +0100 Subject: [PATCH] No more NULL pointers from getDirectoryContent (2) --- src/com/owncloud/android/Uploader.java | 4 ++-- .../owncloud/android/datamodel/FileDataStorageManager.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/owncloud/android/Uploader.java b/src/com/owncloud/android/Uploader.java index 7b66149630..3f67dc2ae9 100644 --- a/src/com/owncloud/android/Uploader.java +++ b/src/com/owncloud/android/Uploader.java @@ -257,7 +257,7 @@ public class Uploader extends ListActivity implements OnItemClickListener, andro // click on folder in the list Log.d(TAG, "on item click"); Vector tmpfiles = mStorageManager.getDirectoryContent(mFile); - if (tmpfiles == null) return; + if (tmpfiles.size() <= 0) return; // filter on dirtype Vector files = new Vector(); for (OCFile f : tmpfiles) @@ -325,7 +325,7 @@ public class Uploader extends ListActivity implements OnItemClickListener, andro mFile = mStorageManager.getFileByPath(full_path); if (mFile != null) { Vector files = mStorageManager.getDirectoryContent(mFile); - if (files != null) { + if (files.size() > 0) { List> data = new LinkedList>(); for (OCFile f : files) { HashMap h = new HashMap(); diff --git a/src/com/owncloud/android/datamodel/FileDataStorageManager.java b/src/com/owncloud/android/datamodel/FileDataStorageManager.java index e0119531bd..3adebeeb17 100644 --- a/src/com/owncloud/android/datamodel/FileDataStorageManager.java +++ b/src/com/owncloud/android/datamodel/FileDataStorageManager.java @@ -456,7 +456,7 @@ public class FileDataStorageManager implements DataStorageManager { // TODO consider possible failures if (dir != null && dir.isDirectory() && dir.getFileId() != -1) { Vector children = getDirectoryContent(dir); - if (children != null) { + if (children.size() > 0) { OCFile child = null; for (int i=0; i