Loadcacheable properly loads profiles from static data
- Fixed a bug in downloading profiles from web would write "null" to file if it failed to get a proper file
This commit is contained in:
parent
d7666e0924
commit
fd76f828ed
2 changed files with 13 additions and 11 deletions
|
|
@ -198,17 +198,19 @@ namespace MatterHackers.MatterControl.SettingsManagement
|
|||
if (!File.Exists(cachePath))
|
||||
{
|
||||
var profile = await ApplicationController.DownloadPublicProfileAsync(profileKey);
|
||||
|
||||
string profileJson = JsonConvert.SerializeObject(profile);
|
||||
if (!string.IsNullOrEmpty(profileJson))
|
||||
if(profile != null)
|
||||
{
|
||||
File.WriteAllText(cachePath, profileJson);
|
||||
}
|
||||
if (syncReport != null)
|
||||
{
|
||||
reportValue.actionLabel = String.Format("Downloading public profiles for {0}...", oem);
|
||||
reportValue.percComplete = (double)index / OemProfiles.Count;
|
||||
syncReport.Report(reportValue);
|
||||
string profileJson = JsonConvert.SerializeObject(profile);
|
||||
if (!String.IsNullOrEmpty(profileJson))
|
||||
{
|
||||
File.WriteAllText(cachePath, profileJson);
|
||||
}
|
||||
if (syncReport != null)
|
||||
{
|
||||
reportValue.actionLabel = String.Format("Downloading public profiles for {0}...", oem);
|
||||
reportValue.percComplete = (double)index / OemProfiles.Count;
|
||||
syncReport.Report(reportValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue