Added check if tn is null
 lsesdfadrPlease enter the commit message for your changes. Lines starting