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

Commit e192cb71 authored by Tomasz Mikolajewski's avatar Tomasz Mikolajewski
Browse files

Fix crash in isChildDocument when parent is in zip, and child not.

There is no regular file representation for archive documents, so
the call to getFileForDocId(archivedDocId) was throwing an exception.

Bug: 27383423
Change-Id: Icbc1e8ecdddc7698cfdb79b41da6e1d3cecf11ae
parent 52cdc159
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -391,6 +391,10 @@ public class ExternalStorageProvider extends DocumentsProvider {
            if (mArchiveHelper.isArchivedDocument(docId)) {
                return mArchiveHelper.isChildDocument(parentDocId, docId);
            }
            // Archives do not contain regular files.
            if (mArchiveHelper.isArchivedDocument(parentDocId)) {
                return false;
            }

            final File parent = getFileForDocId(parentDocId).getCanonicalFile();
            final File doc = getFileForDocId(docId).getCanonicalFile();