Update command.js

Fix the throwing error on error