diff --git a/src/shared/directoryentry.cpp b/src/shared/directoryentry.cpp index e1cba08ca..cebf270ec 100644 --- a/src/shared/directoryentry.cpp +++ b/src/shared/directoryentry.cpp @@ -213,9 +213,9 @@ void FilesOrigin::setName(const std::wstring &name) std::vector FilesOrigin::getFiles() const { std::vector result; - for (FileEntry::Index fileIdx : m_Files) { - result.push_back(m_FileRegister.lock()->getFile(fileIdx)); - } + for (FileEntry::Index fileIdx : m_Files) + if (FileEntry::Ptr p = m_FileRegister.lock()->getFile(fileIdx)) + result.push_back(p); return result; }