Check for null

sometimes the result is null and a warning is displayed.  check for null.
Merge pull request #4 from asecondwill/patch-1

Check for null