pmpermission: fixed an exception thrown when rebuilding permission.