增加try 防止崩溃

This commit is contained in:
chfei committed 2026-10-21 17:07:34 +08:00
1 parent 833c653d3e
commit 912d7f9ca3
1 file changed
+14
+14
View File
@@ -41,6 +41,8 @@ public class ImageCacheService
public static Dictionary<string, ImageCache> GetImageCaches(PDDProductInfo product) public static Dictionary<string, ImageCache> GetImageCaches(PDDProductInfo product)
{ {
Dictionary<string, ImageCache> wxImgMapDic = new Dictionary<string, ImageCache>(StringComparer.OrdinalIgnoreCase); Dictionary<string, ImageCache> wxImgMapDic = new Dictionary<string, ImageCache>(StringComparer.OrdinalIgnoreCase);
try
{
//if (EnvironmentHelper.IsProduction) //if (EnvironmentHelper.IsProduction)
//{ //{
// return wxImgMapDic; // return wxImgMapDic;
@@ -73,6 +75,11 @@ public class ImageCacheService
wxImgMapDic[item.Md5] = item; wxImgMapDic[item.Md5] = item;
} }
} }
}
catch(Exception ex)
{
}
return wxImgMapDic; return wxImgMapDic;
} }
@@ -82,6 +89,8 @@ public class ImageCacheService
/// <param name="platform"></param> /// <param name="platform"></param>
/// <param name="images"></param> /// <param name="images"></param>
public static void SaveImageCaches(PlatformType platform, IEnumerable<ImageCache> images) public static void SaveImageCaches(PlatformType platform, IEnumerable<ImageCache> images)
{
try
{ {
//if (EnvironmentHelper.IsProduction) //if (EnvironmentHelper.IsProduction)
//{ //{
@@ -118,6 +127,11 @@ public class ImageCacheService
{ {
item.IsCache = !failed.Contains(item.Md5, StringComparer.OrdinalIgnoreCase); item.IsCache = !failed.Contains(item.Md5, StringComparer.OrdinalIgnoreCase);
} }
}
catch
{
}
} }