checking for null and whitespace cursor