Add check if any values were returned from the database. See #1257.