Check for null

sometimes the result is null and a warning is displayed.  check for null.