add missing null check in thread destroy introduced by object base unification