Check for NULL before accessing structs
Merge pull request #13 from mgeier/null-check

Check for NULL before accessing structs