fix(dart/transform): Gracefully handle empty .ng_meta.json files
Fix the `template_compiler` step to gracefully handle null & empty .ng_meta.json files.
This commit is contained in:
@ -22,8 +22,8 @@ import 'package:barback/barback.dart';
|
||||
Future<CompileDataResults> createCompileData(
|
||||
AssetReader reader, AssetId assetId) async {
|
||||
return logElapsedAsync(() async {
|
||||
return (await _CompileDataCreator.create(reader, assetId))
|
||||
.createCompileData();
|
||||
final creator = await _CompileDataCreator.create(reader, assetId);
|
||||
return creator != null ? creator.createCompileData() : null;
|
||||
}, operationName: 'createCompileData', assetId: assetId);
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,7 @@ import 'compile_data_creator.dart';
|
||||
Future<Outputs> processTemplates(AssetReader reader, AssetId assetId,
|
||||
{bool reflectPropertiesAsAttributes: false}) async {
|
||||
var viewDefResults = await createCompileData(reader, assetId);
|
||||
if (viewDefResults == null) return null;
|
||||
final directiveMetadatas = viewDefResults.ngMeta.types.values;
|
||||
if (directiveMetadatas.isNotEmpty) {
|
||||
var processor = new reg.Processor();
|
||||
|
Reference in New Issue
Block a user