Add a null check.
Check ref point is valid before rendering.