Index: pkg/front_end/lib/src/incremental_kernel_generator_impl.dart |
diff --git a/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart b/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart |
index 39930073fdf8a50070e64340bbb26d9eb9c59f9c..5462ec569bf7984b9163b00e30388b79c793ca79 100644 |
--- a/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart |
+++ b/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart |
@@ -136,12 +136,14 @@ class IncrementalKernelGeneratorImpl implements IncrementalKernelGenerator { |
// that imports a changed one, is affected. |
// Set the main method. |
- for (var library in program.libraries) { |
- if (library.fileUri == _entryPoint.toString()) { |
- program.mainMethod = library.procedures.firstWhere( |
- (procedure) => procedure.name.name == 'main', |
- orElse: () => null); |
- break; |
+ if (program.libraries.isNotEmpty) { |
+ for (Library library in results.last.kernelLibraries) { |
+ if (library.importUri == _entryPoint) { |
+ program.mainMethod = library.procedures.firstWhere( |
+ (procedure) => procedure.name.name == 'main', |
+ orElse: () => null); |
+ break; |
+ } |
} |
} |