Skip to content

Commit

Permalink
Fix out of range exception in deployment tool (#1682)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evangelink authored May 30, 2023
1 parent e995327 commit 29f69aa
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,9 @@ protected IEnumerable<DeploymentItem> GetSatellites(IEnumerable<DeploymentItem>
string satelliteDir = Path.GetDirectoryName(satellite).TrimEnd(
new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar });

DebugEx.Assert(!StringEx.IsNullOrEmpty(satelliteDir), "DeploymentManager.DoDeployment: got empty satellite dir!");
DebugEx.Assert(satelliteDir.Length > itemDir.Length + 1, "DeploymentManager.DoDeployment: wrong satellite dir length!");

string localeDir = satelliteDir.Substring(itemDir.Length + 1);
DebugEx.Assert(!StringEx.IsNullOrEmpty(localeDir), "DeploymentManager.DoDeployment: got empty dir name for satellite dir!");

string localeDir = itemDir.Length > satelliteDir.Length
? string.Empty
: satelliteDir.Substring(itemDir.Length + 1);
string relativeOutputDir = Path.Combine(item.RelativeOutputDirectory, localeDir);

// Now finally add the item!
Expand Down

0 comments on commit 29f69aa

Please sign in to comment.