Fixing a null check