Nevermind, I think I see. You just wrapped the related=related.parentNode line in a try block.
(*) Discounts available for the above products!