check for NULL
Merge pull request #2 from mwotton/master

check for NULL