From f302751a23d673df4b5d4729f86e83ee6a39df79 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 24 Apr 2013 17:10:39 -0700 Subject: [PATCH] Don't report zero grep results as error Test Plan: Grepped for non-existing string. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5776 --- .../diffusion/controller/DiffusionBrowseController.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/applications/diffusion/controller/DiffusionBrowseController.php b/src/applications/diffusion/controller/DiffusionBrowseController.php index be2df62dad..450646e046 100644 --- a/src/applications/diffusion/controller/DiffusionBrowseController.php +++ b/src/applications/diffusion/controller/DiffusionBrowseController.php @@ -209,9 +209,12 @@ final class DiffusionBrowseController extends DiffusionController { } } catch (CommandException $ex) { - return id(new AphrontErrorView()) - ->setTitle(pht('Search Error')) - ->appendChild($ex->getStderr()); + $stderr = $ex->getStderr(); + if ($stderr != '') { + return id(new AphrontErrorView()) + ->setTitle(pht('Search Error')) + ->appendChild($stderr); + } } $results = array_slice($results, $page);