Possible use of null pointer.

Or maybe better to add CCASSERT.
Merge pull request #7000 from iSevenDays/patch-13

Possible use of null pointer.