trivial-builders: fix evaluation when entries is empty (#490790)

This commit is contained in:
Matt Sturgeon
2026-02-15 19:21:49 +00:00
committed by GitHub
@@ -687,7 +687,7 @@ rec {
# This is the best we can do since the other attrs are either defined here, or curried values that
# we cannot extract a position from
pos =
if lib.isAttrs entries then
if (lib.isAttrs entries) && (entries != { }) then
builtins.unsafeGetAttrPos (builtins.head (builtins.attrNames entries)) entries
else
null;