Merge "libsnapuserd: Handle empty response from server" into main
This commit is contained in:
commit
71707037b1
1 changed files with 5 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue