From 0629854c2648541a13e91c96bd2ab277d126dc4b Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Fri, 31 May 2013 09:14:51 -0400
Subject: [PATCH] Rethrow exception if it is not tagged. Extra safety check for
 RSS detection.

---
 module/VuFind/src/VuFind/Controller/AbstractSearch.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/module/VuFind/src/VuFind/Controller/AbstractSearch.php b/module/VuFind/src/VuFind/Controller/AbstractSearch.php
index 1adb027f010..be906c0b794 100644
--- a/module/VuFind/src/VuFind/Controller/AbstractSearch.php
+++ b/module/VuFind/src/VuFind/Controller/AbstractSearch.php
@@ -246,6 +246,8 @@ class AbstractSearch extends AbstractBase
                 $view->results = $this->getResultsManager()->get('EmptySet');
                 $view->results->setParams($params);
                 $view->results->performAndProcessSearch();
+            } else {
+                throw $e;
             }
         }
         // Save statistics:
@@ -255,7 +257,9 @@ class AbstractSearch extends AbstractBase
         }
 
         // Special case: If we're in RSS view, we need to render differently:
-        if ($view->results->getParams()->getView() == 'rss') {
+        if (isset($view->results)
+            && $view->results->getParams()->getView() == 'rss'
+        ) {
             $response = $this->getResponse();
             $response->getHeaders()->addHeaderLine('Content-type', 'text/xml');
             $feed = $this->getViewRenderer()->plugin('resultfeed');
-- 
GitLab