From 0d6bb6aee8545df2cc9d3a206302a533454c0622 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Fri, 22 Feb 2019 19:25:24 -0800 Subject: [PATCH] only perform multi-root mapping if there are multiple roots (#28352) --- packages/flutter_tools/lib/src/compile.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/flutter_tools/lib/src/compile.dart b/packages/flutter_tools/lib/src/compile.dart index 4b69371e8e..1193a9a1b9 100644 --- a/packages/flutter_tools/lib/src/compile.dart +++ b/packages/flutter_tools/lib/src/compile.dart @@ -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())