SortBox::handleRequest(): check whether $this->query !== null

refs #9220
This commit is contained in:
Alexander A. Klimov 2015-05-12 10:29:50 +02:00
parent dd58f1466c
commit afa0dc0956
1 changed files with 7 additions and 5 deletions

View File

@ -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;
}