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

Commit 32e02cc6 authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Android (Google) Code Review
Browse files

Merge "Check return value in screencap in case of failure."

parents f2503f2f 7f4dc7e3
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -207,7 +207,14 @@ int main(int argc, char** argv)

    result = outBuffer->lock(GraphicBuffer::USAGE_SW_READ_OFTEN, &base);

    if (base == NULL) {
    if (base == nullptr || result != NO_ERROR) {
        String8 reason;
        if (base == nullptr) {
            reason = "Failed to write to buffer";
        } else {
            reason.appendFormat("Error Code: %d", result);
        }
        fprintf(stderr, "Failed to take screenshot (%s)\n", reason.c_str());
        close(fd);
        return 1;
    }