From c2461fca6b2a9eb13ba49403eac474ac0c6991ad Mon Sep 17 00:00:00 2001 From: VS MobileTools Engineering Service 2 Date: Mon, 8 Feb 2021 16:54:28 -0800 Subject: [PATCH] [msbuild] Don't try to find frameworks in a directory that doesn't exist. (#10591) Check if the .app has a Frameworks directory before trying to iterate over any *.framework directories it may have. Co-authored-by: Rolf Bjarne Kvinge --- .../Tasks/ArchiveTaskBase.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/msbuild/Xamarin.iOS.Tasks.Core/Tasks/ArchiveTaskBase.cs b/msbuild/Xamarin.iOS.Tasks.Core/Tasks/ArchiveTaskBase.cs index 3faf4d0e47e6..e294134e0077 100644 --- a/msbuild/Xamarin.iOS.Tasks.Core/Tasks/ArchiveTaskBase.cs +++ b/msbuild/Xamarin.iOS.Tasks.Core/Tasks/ArchiveTaskBase.cs @@ -174,12 +174,15 @@ public override bool Execute () } // for each user framework that is bundled inside the app we must also archive their dSYMs, if available - foreach (var fx in Directory.GetDirectories (Path.Combine (AppBundleDir.ItemSpec, "Frameworks"), "*.framework")) { - var dsym = Path.GetFileName (fx) + ".dSYM"; - var fq_dsym = Path.Combine (AppBundleDir.ItemSpec, "..", dsym); - if (Directory.Exists (fq_dsym)) { - var destDir = Path.Combine (archiveDir, "dSYMs", dsym); - Ditto (fq_dsym, destDir); + var fwks = Path.Combine (AppBundleDir.ItemSpec, "Frameworks"); + if (Directory.Exists (fwks)) { + foreach (var fx in Directory.GetDirectories (fwks, "*.framework")) { + var dsym = Path.GetFileName (fx) + ".dSYM"; + var fq_dsym = Path.Combine (AppBundleDir.ItemSpec, "..", dsym); + if (Directory.Exists (fq_dsym)) { + var destDir = Path.Combine (archiveDir, "dSYMs", dsym); + Ditto (fq_dsym, destDir); + } } }