Fixed potential null pointer reference.