Unverified Commit cb2cfac0 authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Check for presence of an asset directory before accessing it (#12790)

Fixes https://github.com/flutter/flutter/issues/12460
parent 1affb423
......@@ -446,6 +446,9 @@ class _AssetDirectoryCache {
final String assetName = fs.path.basename(assetPath);
final String directory = fs.path.dirname(assetPath);
if (!fs.directory(directory).existsSync())
return const <String>[];
if (_cache[directory] == null) {
final List<String> paths = <String>[];
for (FileSystemEntity entity in fs.directory(directory).listSync(recursive: true)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment