message: ProfileModList: Flatten map() calls and add icon fallback to cache
diff: @@ -36,22 +36,27 @@ export default class ProfileModList {
  }
  try {
  try {
  - return await fs.readFile(path.join(profile.getPathOfProfile(), 'mods.yml'))
  - .then(value => value.toString())
  - .then(value => {
  - return yaml.parse(value)
  - .map((mod: ManifestV2) => new ManifestV2().fromReactive(mod))
  - .map((mod: ManifestV2) => {
  + const value = yaml.parse((await fs.readFile(path.join(profile.getPathOfProfile(), 'mods.yml'))).toString());
  + for(let modIndex in value){
  + const mod = new ManifestV2().fromReactive(value[modIndex]);
  + const fallbackPath = path.join(PathResolver.MOD_ROOT, "cache", mod.getName(), mod.getVersionNumber().toString(), "icon.png");
  + let iconPath;
  if (
  BEPINEX_VARIANTS[GameManager.activeGame.internalFolderName]
  .find(x => x.packageName === mod.getName()) !== undefined
  ) // BepInEx is not a plugin, and the only place where we can get its icon is from the cache
  - mod.setIcon(path.resolve(profile.getPathOfProfile(), "BepInEx", "core", "icon.png"));
  + iconPath = path.resolve(profile.getPathOfProfile(), "BepInEx", "core", "icon.png");
  else
  - mod.setIcon(path.resolve(profile.getPathOfProfile(), "BepInEx", "plugins", mod.getName(), "icon.png"));
  - return mod;
  - });
  - });
  + iconPath = path.resolve(profile.getPathOfProfile(), "BepInEx", "plugins", mod.getName(), "icon.png");
  +
  + if (await fs.exists(iconPath))
  + mod.setIcon(iconPath);
  + else
  + mod.setIcon(fallbackPath);
  +
  + value[modIndex] = mod;
  + }
  + return value;
  } catch(e) {
  const err: Error = e;
  return new YamlParseError(
  