only perform multi-root mapping if there are multiple roots (#28352)

This commit is contained in:
Jonah Williams
2019-02-22 19:25:24 -08:00
committed by GitHub
parent 7baffa6e72
commit 0d6bb6aee8

View File

@@ -117,7 +117,11 @@ class PackageUriMapper {
for (String packageName in packageMap.keys) {
final String prefix = packageMap[packageName].toString();
if (fileSystemScheme != null && fileSystemRoots != null && prefix.contains(fileSystemScheme)) {
// Only perform a multi-root mapping if there are multiple roots.
if (fileSystemScheme != null
&& fileSystemRoots != null
&& fileSystemRoots.length > 1
&& prefix.contains(fileSystemScheme)) {
_packageName = packageName;
_uriPrefixes = fileSystemRoots
.map((String name) => Uri.file(name, windows: platform.isWindows).toString())