[tor-commits] [tor/master] Move #9731 checks to start of their functions