modules/hyprland/backend: handle empty json responses

Fixes https://github.com/Alexays/Waybar/issues/3388
This commit is contained in:
Austin Horstman
2024-06-28 13:11:50 -05:00
parent f6482c36dc
commit c08660d837
3 changed files with 21 additions and 3 deletions

View File

@ -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