Check for null character in query