mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Fix run_query throwing exception when inccorect query and no suggestions returned
This commit is contained in:
@@ -272,10 +272,10 @@ EOF
|
||||
{
|
||||
$sWrongWord = $e->GetWrongWord();
|
||||
$aSuggestedWords = $e->GetSuggestions();
|
||||
if (count($aSuggestedWords) > 0)
|
||||
if (is_countable($aSuggestedWords) && count($aSuggestedWords) > 0)
|
||||
{
|
||||
$sSuggestedWord = OqlException::FindClosestString($sWrongWord, $aSuggestedWords);
|
||||
|
||||
|
||||
if (strlen($sSuggestedWord) > 0)
|
||||
{
|
||||
$oP->p('<b>'.Dict::Format('UI:RunQuery:Error', $e->GetIssue().' <em>'.$sWrongWord).'</em></b>');
|
||||
|
||||
Reference in New Issue
Block a user