Only verify source hash if there is one am: dc122bcb2d

Original change: https://android-review.googlesource.com/c/platform/system/update_engine/+/2027246

Change-Id: I1e903db87145bed8a1946cff75c0749e492c34d1
diff --git a/payload_consumer/vabc_partition_writer.cc b/payload_consumer/vabc_partition_writer.cc
index 583ba4c..54aea86 100644
--- a/payload_consumer/vabc_partition_writer.cc
+++ b/payload_consumer/vabc_partition_writer.cc
@@ -273,6 +273,9 @@
   auto source_fd = std::make_shared<EintrSafeFileDescriptor>();
   TEST_AND_RETURN_FALSE_ERRNO(
       source_fd->Open(install_part_.source_path.c_str(), O_RDONLY));
+  if (!operation.has_src_sha256_hash()) {
+    return true;
+  }
   return PartitionWriter::ValidateSourceHash(
       operation, source_fd, block_size_, error);
 }