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

Commit 3fd5bded authored by Andy Scherzinger's avatar Andy Scherzinger Committed by GitHub
Browse files

Merge pull request #70 from nextcloud/fixNPE

Prevent npe if missing contenttype via webdav
parents 4e6c4ad7 b415f1b5
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;
                    }
                }
            }