modules/hyprland/backend: handle empty json responses
Fixes https://github.com/Alexays/Waybar/issues/3388
This commit is contained in:
@ -218,7 +218,13 @@ std::string IPC::getSocket1Reply(const std::string& rq) {
|
||||
}
|
||||
|
||||
Json::Value IPC::getSocket1JsonReply(const std::string& rq) {
|
||||
return parser_.parse(getSocket1Reply("j/" + rq));
|
||||
std::string reply = getSocket1Reply("j/" + rq);
|
||||
|
||||
if (reply.empty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return parser_.parse(reply);
|
||||
}
|
||||
|
||||
} // namespace waybar::modules::hyprland
|
||||
|
Reference in New Issue
Block a user