Added safeguarding against using commands when the active project is null.