Skip to content

Commit 29f69aa

Browse files
authored
Fix out of range exception in deployment tool (#1682)
1 parent e995327 commit 29f69aa

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/Adapter/MSTestAdapter.PlatformServices/Utilities/DeploymentUtility.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,9 @@ protected IEnumerable<DeploymentItem> GetSatellites(IEnumerable<DeploymentItem>
184184
string satelliteDir = Path.GetDirectoryName(satellite).TrimEnd(
185185
new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar });
186186

187-
DebugEx.Assert(!StringEx.IsNullOrEmpty(satelliteDir), "DeploymentManager.DoDeployment: got empty satellite dir!");
188-
DebugEx.Assert(satelliteDir.Length > itemDir.Length + 1, "DeploymentManager.DoDeployment: wrong satellite dir length!");
189-
190-
string localeDir = satelliteDir.Substring(itemDir.Length + 1);
191-
DebugEx.Assert(!StringEx.IsNullOrEmpty(localeDir), "DeploymentManager.DoDeployment: got empty dir name for satellite dir!");
192-
187+
string localeDir = itemDir.Length > satelliteDir.Length
188+
? string.Empty
189+
: satelliteDir.Substring(itemDir.Length + 1);
193190
string relativeOutputDir = Path.Combine(item.RelativeOutputDirectory, localeDir);
194191

195192
// Now finally add the item!

0 commit comments

Comments
 (0)