diff --git a/zlibrary/core/src/filesystem/tar/ZLTar.cpp b/zlibrary/core/src/filesystem/tar/ZLTar.cpp index 2b16c5268..627c50477 100644 --- a/zlibrary/core/src/filesystem/tar/ZLTar.cpp +++ b/zlibrary/core/src/filesystem/tar/ZLTar.cpp @@ -193,6 +193,7 @@ size_t ZLTarInputStream::sizeOfOpened() { void ZLTarDir::collectFiles(std::vector &names, bool) { shared_ptr stream = ZLFile(path()).inputStream(); + if (stream == 0) return; const ZLTarHeaderCache &cache = ZLTarHeaderCache::cache(*stream); cache.collectFileNames(names); } diff --git a/zlibrary/core/src/filesystem/zip/ZLZipDir.cpp b/zlibrary/core/src/filesystem/zip/ZLZipDir.cpp index 671ac7cf6..de0d0e6b2 100644 --- a/zlibrary/core/src/filesystem/zip/ZLZipDir.cpp +++ b/zlibrary/core/src/filesystem/zip/ZLZipDir.cpp @@ -23,6 +23,7 @@ void ZLZipDir::collectFiles(std::vector &names, bool) { shared_ptr stream = ZLFile(path()).inputStream(); + if (stream == 0) return; const ZLZipEntryCache &cache = ZLZipEntryCache::cache(*stream); cache.collectFileNames(names); }