Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 11aa621

Browse files
committed
fix: handle empty body for engines install
1 parent e86c20c commit 11aa621

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

engine/controllers/engines.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ void Engines::InstallEngine(
2020
return;
2121
}
2222

23-
auto version = (*(req->getJsonObject())).get("version", "latest").asString();
23+
std::string version = "latest";
24+
if (auto o = req->getJsonObject(); !o) {
25+
version = (*o).get("version", "latest").asString();
26+
}
27+
2428
auto result = engine_service_->InstallEngineAsync(engine, version);
2529
if (result.has_error()) {
2630
Json::Value res;

0 commit comments

Comments
 (0)