Skip to content

Commit

Permalink
Added a webhook handler if updated is null and refresh entire palette…
Browse files Browse the repository at this point in the history
… list
  • Loading branch information
CPKreu committed May 20, 2024
1 parent 3791380 commit 4fb9f59
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/PixiEditor/Models/DataProviders/LocalPalettesFetcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,23 @@ private async Task RefreshCache(RefreshType refreshType, string file)
default:
throw new ArgumentOutOfRangeException(nameof(refreshType), refreshType, null);
}

if (refreshType is RefreshType.Created or RefreshType.Updated && updated == null)
{
await RefreshCacheAll();

try
{
throw new NullReferenceException($"The '{nameof(updated)}' was null even though the refresh type was '{refreshType}'.");
}
catch (Exception e)
{
await CrashHelper.SendExceptionInfoToWebhookAsync(e);
}

return;
}

CacheUpdated?.Invoke(refreshType, updated, affectedFileName);
}

Expand Down

0 comments on commit 4fb9f59

Please sign in to comment.