Added a check to see if a command is enabled before querying the command's state.
This is a fix for the exception FF throws when querying a command state that is disabled.