Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit b415f1b5 authored by tobiasKaminsky's avatar tobiasKaminsky
Browse files

prevent npe if missing contenttype via webdav

parent 4e6c4ad7
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -92,11 +92,15 @@ public class WebdavEntry {
            mContentType = "application/octet-stream";
            prop = propSet.get(DavPropertyName.GETCONTENTTYPE);
            if (prop != null) {
                mContentType = (String) prop.getValue();
                String contentType = (String) prop.getValue();
                // dvelasco: some builds of ownCloud server 4.0.x added a trailing ';'
                // to the MIME type ; if looks fixed, but let's be cautious
                if (mContentType.indexOf(";") >= 0) {
                    mContentType = mContentType.substring(0, mContentType.indexOf(";"));
                if (contentType != null) {
                    if (contentType.contains(";")) {
                        mContentType = contentType.substring(0, contentType.indexOf(";"));
                    } else {
                        mContentType = contentType;
                    }
                }
            }