From afa0dc0956b23ae91e654d4d0ea7defd0378c321 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 12 May 2015 10:29:50 +0200 Subject: [PATCH] SortBox::handleRequest(): check whether $this->query !== null refs #9220 --- library/Icinga/Web/Widget/SortBox.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/library/Icinga/Web/Widget/SortBox.php b/library/Icinga/Web/Widget/SortBox.php index 7896fb8ef..022efdf32 100644 --- a/library/Icinga/Web/Widget/SortBox.php +++ b/library/Icinga/Web/Widget/SortBox.php @@ -109,11 +109,13 @@ class SortBox extends AbstractWidget public function handleRequest(Request $request = null) { - if ($request === null) { - $request = Icinga::app()->getFrontController()->getRequest(); - } - if ($sort = $request->getParam('sort')) { - $this->query->order($sort, $request->getParam('dir')); + if ($this->query !== null) { + if ($request === null) { + $request = Icinga::app()->getFrontController()->getRequest(); + } + if ($sort = $request->getParam('sort')) { + $this->query->order($sort, $request->getParam('dir')); + } } return $this; }