From 60a925008bc353136ba5babce437f42819c1645c Mon Sep 17 00:00:00 2001 From: Yingchi Long Date: Wed, 26 Jun 2024 15:33:29 +0800 Subject: [PATCH] nixd/Controller/Definition: explicitly check optional package position (NFC) This is a No-Functional-Change that aims to shut up clang-tidy. --- nixd/lib/Controller/Definition.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nixd/lib/Controller/Definition.cpp b/nixd/lib/Controller/Definition.cpp index 5781b256b..7ab68f419 100644 --- a/nixd/lib/Controller/Definition.cpp +++ b/nixd/lib/Controller/Definition.cpp @@ -155,11 +155,13 @@ class NixpkgsDefinitionProvider { if (!Desc) return Desc.takeError(); - if (!Desc->Position) + const std::optional &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()); }