-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: tech-debtTechnical debt, code quality, testing, etc.Technical debt, code quality, testing, etc.team-toolOwned by Flutter Tool teamOwned by Flutter Tool team
Description
I've seen this come up in refactoring tests, but not in real code, and I think it's a bug:
import 'package:file/file.dart';
import 'package:flutter_tools/src/dart/package_map.dart' show findPackageConfigFile;
void example(FileSystem fileSystem) {
// Pick a clearly non-existent directory.
final Directory directory = fileSystem.directory('i/do/not/exist');
print(findPackageConfigFile(directory)); // Expected: null, but throws
}This is because fileSystem.identicalSync throws if one or more of the paths are missing, and is used and I think this can be fixed by ensuring the path being checked actually exists (if it doesn't, then continue looking).
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: tech-debtTechnical debt, code quality, testing, etc.Technical debt, code quality, testing, etc.team-toolOwned by Flutter Tool teamOwned by Flutter Tool team