From ccffc97da8c768a4820bb885a40aede8151b7c4b Mon Sep 17 00:00:00 2001 From: dabutvin Date: Sun, 29 Sep 2019 14:20:59 -0700 Subject: [PATCH] make sure fileAfter size is greater than 0 before adding --- CompressImagesFunction/CompressImages.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CompressImagesFunction/CompressImages.cs b/CompressImagesFunction/CompressImages.cs index 550526b7c..5e28459ac 100644 --- a/CompressImagesFunction/CompressImages.cs +++ b/CompressImagesFunction/CompressImages.cs @@ -186,7 +186,7 @@ private static CompressionResult[] OptimizeImages(Repository repo, string localP } FileInfo fileAfter = new FileInfo(image); - if (fileAfter.Length < before) + if (fileAfter.Length < before && fileAfter.Length > 0) { optimizedImages.Add(new CompressionResult {