diff --git a/CompressImagesFunction/RepoChecks.cs b/CompressImagesFunction/RepoChecks.cs index 0f123a367..03242c1c3 100644 --- a/CompressImagesFunction/RepoChecks.cs +++ b/CompressImagesFunction/RepoChecks.cs @@ -15,10 +15,16 @@ public async Task IsArchived(GitHubClientParameters parameters) var githubClient = new GitHubClient( new ProductHeaderValue("ImgBot"), inMemoryCredentialStore); - var repo = await githubClient.Repository.Get( - parameters.RepoOwner, parameters.RepoName); - - return repo.Archived; + try + { + var repo = await githubClient.Repository.Get( + parameters.RepoOwner, parameters.RepoName); + return repo.Archived; + } + catch (NotFoundException) + { + return true; // not found can be treated the same as archived + } } } }