diff --git a/owncloudApp/src/main/java/com/owncloud/android/utils/FileStorageUtils.java b/owncloudApp/src/main/java/com/owncloud/android/utils/FileStorageUtils.java index 684c6bbabab..a968ac2dcc3 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/utils/FileStorageUtils.java +++ b/owncloudApp/src/main/java/com/owncloud/android/utils/FileStorageUtils.java @@ -105,7 +105,8 @@ public static String getParentPath(String remotePath) { public static OCFile createOCFileFromRemoteFile(RemoteFile remote) { OCFile file = new OCFile(remote.getRemotePath()); file.setCreationTimestamp(remote.getCreationTimestamp()); - if (remote.getMimeType().equalsIgnoreCase("DIR")) { + if (remote.getMimeType() != null && + remote.getMimeType().equalsIgnoreCase("DIR")) { file.setFileLength(remote.getSize()); } else { file.setFileLength(remote.getLength());