Fix handling of empty --project-assets option (#6873)

This commit is contained in:
John McCutchan 2016-11-15 13:47:57 -08:00 committed by Todd Volkert
parent 2b84d1ff1b
commit ae1881e4c7
2 changed files with 6 additions and 0 deletions

View File

@ -69,6 +69,8 @@ class AssetBundle {
List<String> assets = projectAssets.split(',');
for (String asset in assets) {
if (asset == '')
continue;
final String assetPath = path.join(projectRoot, asset);
final String archivePath = asset;
entries.add(

View File

@ -28,6 +28,10 @@ void main() {
test('does not need a rebuild', () async {
expect(new AssetBundle.fixed(null, null).needsBuild(), isFalse);
});
test('empty string', () async {
AssetBundle ab = new AssetBundle.fixed('', '');
expect(ab.entries, isEmpty);
});
test('single entry', () async {
AssetBundle ab = new AssetBundle.fixed('', 'apple.txt');
expect(ab.entries, isNotEmpty);