Browse Source

No more NULL pointers from getDirectoryContent

David A. Velasco 12 years ago
parent
commit
e81a7790eb
1 changed files with 2 additions and 3 deletions
  1. 2 3
      src/com/owncloud/android/datamodel/FileDataStorageManager.java

+ 2 - 3
src/com/owncloud/android/datamodel/FileDataStorageManager.java

@@ -292,8 +292,8 @@ public class FileDataStorageManager implements DataStorageManager {
 
     @Override
     public Vector<OCFile> getDirectoryContent(OCFile f) {
+        Vector<OCFile> ret = new Vector<OCFile>();
         if (f != null && f.isDirectory() && f.getFileId() != -1) {
-            Vector<OCFile> ret = new Vector<OCFile>();
 
             Uri req_uri = Uri.withAppendedPath(
                     ProviderTableMeta.CONTENT_URI_DIR,
@@ -326,9 +326,8 @@ public class FileDataStorageManager implements DataStorageManager {
             
             Collections.sort(ret);
             
-            return ret;
         }
-        return null;
+        return ret;
     }
 
     private boolean fileExists(String cmp_key, String value) {