public static ProfileModel LoadProfileIfValid(string path)
{
try
{
var prof = JsonConvert.DeserializeObject<ProfileModel>(File.ReadAllText(path));
if (prof == null)
return null;
if (prof.GameName.Length < 1 || prof.KeyboardSlug.Length < 1 || prof.Name.Length < 1)
return null;
return prof;
}
catch (JsonSerializationException)
{
return null;
}
}