formatter: fix UnboundLocalError in engine