Import revision 48308 from the trunk:
Add missing null pointer protection


git-svn-id: https://root.cern.ch/svn/root/branches/v5-34-00-patches@48309 27541ba8-7e3a-0410-8455-c3a389f83636