[ORC] Destroy FinalizeErr if there is a serialization error.

If there is a serialization error then FinalizeErr should never be set, so we
can use cantFail rather than consumeError here.
This commit is contained in:
Lang Hames 2021-10-11 13:42:21 -07:00
parent 8abf46d39a
commit 4fc2a4cc01
1 changed files with 3 additions and 2 deletions

View File

@ -63,9 +63,10 @@ public:
Parent.SAs.Finalize,
[OnFinalize = std::move(OnFinalize)](Error SerializationErr,
Error FinalizeErr) {
if (SerializationErr)
if (SerializationErr) {
cantFail(std::move(FinalizeErr));
OnFinalize(std::move(SerializationErr));
else
} else
OnFinalize(std::move(FinalizeErr));
},
Parent.SAs.Allocator, std::move(FR));