diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index 76fe3c56..684bca9c 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -526,7 +526,8 @@ std::string getReply(std::string request) { format = HyprCtl::FORMAT_JSON; } - request = request.substr(sepIndex + 1); // remove flags and separator so we can compare the rest of the string + if (sepIndex < request.size()) + request = request.substr(sepIndex + 1); // remove flags and separator so we can compare the rest of the string if (request == "monitors") return monitorsRequest(format);