Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7f6cd04 authored by Josh Gao's avatar Josh Gao
Browse files

adb: defuse CHECK on IOVector::append of an empty block.

Bug: http://b/129706741
Test: treehugger
Change-Id: I35a35d20d179a155adb4fe83078739fcaf517136
(cherry picked from commit 3443b774)
parent ac3ca99b
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -216,7 +216,10 @@ struct IOVector {
    // Add a nonempty block to the chain.
    // The end of the chain must be a complete block (i.e. end_offset_ == 0).
    void append(std::unique_ptr<const block_type> block) {
        CHECK_NE(0ULL, block->size());
        if (block->size() == 0) {
            return;
        }

        CHECK_EQ(0ULL, end_offset_);
        chain_length_ += block->size();
        chain_.emplace_back(std::move(block));