When the server returns an empty mimetype on a PROPFIND, the app will crash because it tries to figure out weather the current resource element is a direcotry or not by comparing the returned mimetype against the string DIR. However since the returned mimetype is null the app crashes:
java.lang.String.equalsIgnoreCase(java.lang.String)' on a null object reference
at com.owncloud.android.utils.FileStorageUtils.createOCFileFromRemoteFile(FileStorageUtils.java:108)
at com.owncloud.android.operations.SynchronizeFolderOperation.mergeRemoteFolder(SynchronizeFolderOperation.java:337)
at com.owncloud.android.operations.SynchronizeFolderOperation.run(SynchronizeFolderOperation.java:225)
at com.owncloud.android.lib.common.operations.RemoteOperation.runOperation(RemoteOperation.java:240)
at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:205)
at com.owncloud.android.operations.common.SyncOperation.execute(SyncOperation.java:87)
at com.owncloud.android.operations.RefreshFolderOperation.run(RefreshFolderOperation.java:143)
at com.owncloud.android.lib.common.operations.RemoteOperation.runOperation(RemoteOperation.java:240)
at com.owncloud.android.lib.common.operations.RemoteOperation.run(RemoteOperation.java:259)
This does normally not happen as the server should always send a mimetype, however if he does not we aparently must be prepared.
Steps to reproduce:
- Use mitm proxy and intercept response
- Pull down to refresh inside files view
- When response of propfind is send remove content inside the
<contenttype></contenttype> tag
This may sometimes happen when a user creates a file without file ending, or if a file without file ending is shared.
fix: #2986
When the server returns an empty mimetype on a PROPFIND, the app will crash because it tries to figure out weather the current resource element is a direcotry or not by comparing the returned mimetype against the string
DIR. However since the returned mimetype isnullthe app crashes:This does normally not happen as the server should always send a mimetype, however if he does not we aparently must be prepared.
Steps to reproduce:
<contenttype></contenttype>tagThis may sometimes happen when a user creates a file without file ending, or if a file without file ending is shared.
fix: #2986