mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-13 22:52:30 +02:00
Handle screens disconnection (#29)
This commit is contained in:
@ -14,6 +14,9 @@ struct JsonParser {
|
||||
{
|
||||
Json::Value root;
|
||||
std::string err;
|
||||
if (_reader == nullptr) {
|
||||
throw std::runtime_error("Unable to parse");
|
||||
}
|
||||
bool res =
|
||||
_reader->parse(data.c_str(), data.c_str() + data.size(), &root, &err);
|
||||
if (!res)
|
||||
@ -24,6 +27,7 @@ struct JsonParser {
|
||||
~JsonParser()
|
||||
{
|
||||
delete _reader;
|
||||
_reader = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user