Frontend: fixed potential NRE with commands issued from command hooks