fix NS_ERROR_UNEXPECTED

NS_ERROR_UNEXPECTED in CommandPatch.prototype.queryState