Skip to content

Commit

Permalink
BUGFIX: If query errored, return empty result
Browse files Browse the repository at this point in the history
In order to avoid errors if the query did not return a result object
we return an empty result early on.
  • Loading branch information
kitsunet authored Jul 5, 2016
1 parent 3c86a3c commit 38fc285
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Classes/Flowpack/SimpleSearch/Domain/Service/SqLiteIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ public function addToFulltext($fulltext, $identifier) {
public function query($query) {
$result = $this->connection->query($query);
$resultArray = array();
if ($result === false) {
return $resultArray;
}

while ($resultRow = $result->fetchArray(SQLITE3_ASSOC)) {
$resultArray[] = $resultRow;
}
Expand Down

0 comments on commit 38fc285

Please sign in to comment.