Fixed crash when passing a null pointer
Merge remote-tracking branch 'upstream/master'