Add a null check to prevent theoretically possible crashes
Add a null check to prevent theoretically possible crashes

--HG--
branch : v1-8

ruleless/ogre,ruleless/ogre,ruleless/ogre,ehsan/ogre,ruleless/ogre,bhlzlx/ogre,ruleless/ogre,ehsan/ogre,ehsan/ogre,bhlzlx/ogre,ehsan/ogre,bhlzlx/ogre,ruleless/ogre,bhlzlx/ogre,bhlzlx/ogre,bhlzlx/ogre,ehsan/ogre