From 107b62889da7a0889a316373c3aca5025ed5beb8 Mon Sep 17 00:00:00 2001 From: Myrkur Date: Sun, 16 Feb 2025 19:25:36 -0500 Subject: [PATCH] Fix DirectoryNotFoundException in ImageSaving.cs:CropAllPrints (#1135) * Fix DirectoryNotFoundException in ImageSaving.cs:CropAllPrints * Update Dotnet/AppApi/Common/ImageSaving.cs Oh yeah this is iterating over all existing. Co-authored-by: Lars Olzem --------- Co-authored-by: Lars Olzem --- Dotnet/AppApi/Common/ImageSaving.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dotnet/AppApi/Common/ImageSaving.cs b/Dotnet/AppApi/Common/ImageSaving.cs index ce3426ad..4cdbb7be 100644 --- a/Dotnet/AppApi/Common/ImageSaving.cs +++ b/Dotnet/AppApi/Common/ImageSaving.cs @@ -177,6 +177,11 @@ namespace VRCX public async Task CropAllPrints(string ugcFolderPath) { var folder = Path.Join(GetUGCPhotoLocation(ugcFolderPath), "Prints"); + + if (!Directory.Exists(folder)) + { + return; + } var files = Directory.GetFiles(folder, "*.png", SearchOption.AllDirectories); foreach (var file in files) {