diff --git a/src/ModMan/Web/UiCommunication.h b/src/ModMan/Web/UiCommunication.h index f5f7c2c3..840d6bcf 100644 --- a/src/ModMan/Web/UiCommunication.h +++ b/src/ModMan/Web/UiCommunication.h @@ -33,7 +33,11 @@ namespace ui con::error("Webview params are not an array: {}", req); return ""; } - param = json.at(0).get(); + + if (json.empty()) + param = nlohmann::json().get(); + else + param = json.at(0).get(); } catch (const nlohmann::json::exception& e) { @@ -71,7 +75,11 @@ namespace ui con::error("Webview params are not an array: {}", req); return ""; } - param = json.at(0).get(); + + if (json.empty()) + param = nlohmann::json().get(); + else + param = json.at(0).get(); } catch (const nlohmann::json::exception& e) { @@ -110,7 +118,11 @@ namespace ui con::error("Webview params are not an array: {}", req); return ""; } - param = json.at(0).get(); + + if (json.empty()) + param = nlohmann::json().get(); + else + param = json.at(0).get(); } catch (const nlohmann::json::exception& e) {