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

--HG--
branch : v1-8

jhu-lcsr-forks/ogre,jhu-lcsr-forks/ogre,largerussiangames/ogre,vancepym/ogre,jhu-lcsr-forks/ogre,largerussiangames/ogre,vancepym/ogre,jhu-lcsr-forks/ogre,vancepym/ogre,vancepym/ogre,largerussiangames/ogre,vancepym/ogre,largerussiangames/ogre,nezticle/ogre,nezticle/ogre,jhu-lcsr-forks/ogre,nezticle/ogre,nezticle/ogre