Fixed potential nil pointer reference.