diff options
Diffstat (limited to 'src/nix/search.cc')
-rw-r--r-- | src/nix/search.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nix/search.cc b/src/nix/search.cc index fca49350a..bbac56fcb 100644 --- a/src/nix/search.cc +++ b/src/nix/search.cc @@ -180,7 +180,7 @@ struct CmdSearch : InstallableCommand, MixJSON for (auto & [cursor, prefix] : installable->getCursor(*state, true)) visit(*cursor, parseAttrPath(*state, prefix)); - if (!results) + if (!json && !results) throw Error("no results for the given search term(s)!"); } }; |