commands: Fix a conditional UnboundLocalError