Fix possible null pointer dereference
Merge pull request #748 from authmillenon/fix-possible-null-pointer-errors

bughunt: Fix possible null pointer dereference