From 07e0b156cf007784d2ebc17fb39c06cfd16be706 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Tue, 1 Nov 2022 15:16:50 +0100 Subject: [PATCH] wip Signed-off-by: tobiasKaminsky --- .../android/lib/common/utils/WebDavFileUtils.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/library/src/main/java/com/owncloud/android/lib/common/utils/WebDavFileUtils.java b/library/src/main/java/com/owncloud/android/lib/common/utils/WebDavFileUtils.java index b6c3f90b0..2bdc0fe76 100644 --- a/library/src/main/java/com/owncloud/android/lib/common/utils/WebDavFileUtils.java +++ b/library/src/main/java/com/owncloud/android/lib/common/utils/WebDavFileUtils.java @@ -53,6 +53,7 @@ import at.bitfire.dav4jvm.property.GetContentType; import at.bitfire.dav4jvm.property.GetLastModified; import at.bitfire.dav4jvm.property.ResourceType; +import okhttp3.MediaType; /** * WebDav helper. @@ -125,7 +126,13 @@ public RemoteFile parseResponse(Response response, Uri filesDavUri) { } if (property instanceof GetContentType) { - remoteFile.setMimeType(((GetContentType) property).getType().toString()); + MediaType type = ((GetContentType) property).getType(); + + if (type != null) { + remoteFile.setMimeType(type.toString()); + } else { + remoteFile.setMimeType(""); + } } if (property instanceof ResourceType) {