diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart index 1874b0af50d..2565f3097bc 100644 --- a/pkg/compiler/lib/src/compiler.dart +++ b/pkg/compiler/lib/src/compiler.dart @@ -1947,6 +1947,10 @@ abstract class Compiler implements DiagnosticListener { if (element == null) { element = currentElement; } + if (element == null) { + return null; + } + if (element.sourcePosition != null) { return element.sourcePosition; }