Fix potential nil pointer.