fix for issue #10483

fixes #10483
Please store the result of `$tr.find('div.avatardiv')` in a variable, then reuse it inside the if block.