Merge "Fix nullptr access when cow reader open fails"

This commit is contained in:
Treehugger Robot 2022-12-02 19:25:32 +00:00 committed by Gerrit Code Review
commit 9e6005ada4
1 changed files with 3 additions and 0 deletions

View File

@ -93,6 +93,9 @@ bool CompressedSnapshotWriter::VerifyMergeOps() const noexcept {
std::unique_ptr<FileDescriptor> CompressedSnapshotWriter::OpenReader() {
auto cow = OpenCowReader();
if (cow == nullptr) {
return nullptr;
}
auto reader = std::make_unique<CompressedSnapshotReader>();
if (!reader->SetCow(std::move(cow))) {