Fix #172813 (Crash when removing all rights from a resource)