Guard against NPE when a mod is removed.