Fix null pointer dereference
Merge pull request #317 from Mantle/null-pointer-fix

Fix null pointer dereference