Fixed a potential Null Pointer.