fix uncaught exception when the command doesn't exist

Summary: Ref T671

Test Plan: N/A

Reviewers: yongxing

Reviewed By: yongxing

Maniphest Tasks: T671

Differential Revision: http://phabricator.n.miliao.com/D2675