mirror of
https://github.com/polybar/polybar.git
synced 2024-11-11 13:50:56 -05:00
fix(memory): Set vars to 0 if exception is thrown
This commit is contained in:
parent
f3d04a5a5c
commit
a83ecb36db
1 changed files with 3 additions and 0 deletions
|
@ -45,6 +45,9 @@ bool MemoryModule::update()
|
||||||
buffer >> rdbuf; //kbytes_free = std::atol(rdbuf.c_str());
|
buffer >> rdbuf; //kbytes_free = std::atol(rdbuf.c_str());
|
||||||
buffer >> rdbuf; kbytes_available = std::atol(rdbuf.c_str());
|
buffer >> rdbuf; kbytes_available = std::atol(rdbuf.c_str());
|
||||||
} catch (std::ios_base::failure &e) {
|
} catch (std::ios_base::failure &e) {
|
||||||
|
kbytes_total = 0;
|
||||||
|
// kbytes_free = 0;
|
||||||
|
kbytes_available = 0;
|
||||||
log_error("Failed to read memory values: "+ STR(e.what()));
|
log_error("Failed to read memory values: "+ STR(e.what()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue