Fixed a null check