Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: tobiasKaminsky <[email protected]>
  • Loading branch information
tobiasKaminsky committed Nov 1, 2022
1 parent 0fe738a commit ce3fe7e
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit ce3fe7e

Please sign in to comment.