patchoat: Move nullptr CHECK
We now check 'out' for nullptr prior to dereferencing it.
Test: Treehugger
Change-Id: I4b0f871a24894107b895789a1b73b95847438dcc
diff --git a/patchoat/patchoat.cc b/patchoat/patchoat.cc
index b9a9a69..dc9d990 100644
--- a/patchoat/patchoat.cc
+++ b/patchoat/patchoat.cc
@@ -700,6 +700,7 @@
}
bool PatchOat::WriteImage(File* out) {
+ CHECK(out != nullptr);
TimingLogger::ScopedTiming t("Writing image File", timings_);
std::string error_msg;
@@ -709,7 +710,6 @@
true /* read_only_mode */, &error_msg);
CHECK(image_ != nullptr);
- CHECK(out != nullptr);
size_t expect = image_->Size();
if (out->WriteFully(reinterpret_cast<char*>(image_->Begin()), expect) &&
out->SetLength(expect) == 0) {