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

Commit 454167f5 authored by Akilesh Kailash's avatar Akilesh Kailash
Browse files

libsnapuserd: Handle empty response from server



If server disconnects, then handle the empty response.

Bug: 377068272
Test: Full OTA
Change-Id: Ic48204c457ef924ba9a3c1ae84a3317fb1ccda04
Signed-off-by: default avatarAkilesh Kailash <akailash@google.com>
parent a5560db8
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -311,6 +311,11 @@ double SnapuserdClient::GetMergePercent() {
    }
    std::string response = Receivemsg();

    // If server socket disconnects most likely because of device reboot,
    // then we just return 0.
    if (response.empty()) {
        return 0.0;
    }
    return std::stod(response);
}