Fix crash that occured for string-queries in database that didn't have them