Skip to content

Commit

Permalink
nixd/Controller/Definition: explicitly check optional package positio…
Browse files Browse the repository at this point in the history
…n (NFC)

This is a No-Functional-Change that aims to shut up clang-tidy.
  • Loading branch information
inclyc committed Jun 26, 2024
1 parent 6107557 commit 60a9250
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nixd/lib/Controller/Definition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,13 @@ class NixpkgsDefinitionProvider {
if (!Desc)
return Desc.takeError();

if (!Desc->Position)
const std::optional<std::string> &Position = Desc->Position;

if (!Position)
return error("meta.position is not available for this package");

try {
return parseLocation(*Desc->Position);
return parseLocation(*Position);
} catch (std::exception &E) {
return error(E.what());
}
Expand Down

0 comments on commit 60a9250

Please sign in to comment.