Fixed a bug with a nullpointer in hasCommand