Skip to content

Commit 9f8ca74

Browse files
author
Stewart Miles
committed
Fixed exception in VH when a manifest has no aliases.
In cases where a manifest has no aliases the aliases set lookup in FindAndReadManifestsByPackageName() would throw an exception. This fixes the issue by adding an empty set of aliases for manifests with no aliases. Change-Id: I5c459bb092666088c3eedb33155bf06df75b6285
1 parent 43082b7 commit 9f8ca74

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

source/VersionHandlerImpl/src/VersionHandlerImpl.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1383,7 +1383,7 @@ private static KeyValuePair<string, int> FindHighestPriorityManifestName(
13831383
if (depth > maxDepth) {
13841384
Log(String.Format(
13851385
"Detected manifest name alias loop for name {0}, to fix this change the " +
1386-
"list (see below) to not contain a loop:\n{1}" +
1386+
"list (see below) to not contain a loop:\n{1}",
13871387
name, String.Join("\n", (new List<string>(aliasesByName.Keys)).ToArray())),
13881388
level: LogLevel.Warning);
13891389
return new KeyValuePair<string, int>(name, -1);
@@ -1429,6 +1429,10 @@ private Dictionary<string, HashSet<string>> GetManifestAliasesByName() {
14291429
}
14301430
aliases.Add(metadata.customManifestNames.Values[0]);
14311431
}
1432+
// If there are no aliases, store an empty set.
1433+
if (metadata.customManifestNames.Values.Count == 0) {
1434+
aliasesByName[metadata.ManifestName] = new HashSet<string>();
1435+
}
14321436
}
14331437
}
14341438
// Display adjacency list for debugging.

0 commit comments

Comments
 (0)