[TS] Fix one more segfault possibility.