From 14a3a62bfca6c572b9a415cfa80cdbd7ad4326b3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 7 May 2020 12:13:16 +0200 Subject: [PATCH] Update src/nix/search.cc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jörg Thalheim --- src/nix/search.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)!"); } };