check result is none.
Return none if query is shorter than gram length