private IGameProfile GetGameProfile(IGameFile gameFile) { if (gameFile.SettingsGameProfileID.HasValue) { var profile = DataSourceAdapter.GetGameProfiles(gameFile.GameFileID.Value).FirstOrDefault(x => x.GameProfileID == gameFile.SettingsGameProfileID.Value); if (profile != null) { return(profile); } } return((GameFile)gameFile); }