Skip to content

Commit f8678be

Browse files
committed
Fix accessing nonexistent json element
1 parent d3114f6 commit f8678be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/api/v1/authors/projects.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ namespace api::v1 {
378378
}
379379

380380
const auto details = json["details"];
381-
const auto path = json["path"];
381+
const std::string path = json.contains("path") ? json["path"] : "";
382382
auto resolvedPath = path;
383383
if (!path.empty()) {
384384
const auto filePath = resolved->getPagePath(path);

0 commit comments

Comments
 (0)