Check that TD isn't NULL before dereferencing it down this path.