Don't crash when reporting an error

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org//1157433014
This commit is contained in:
Sigmund Cherem 2015-06-08 13:01:16 -07:00
parent c60c313f59
commit e20001a07f

View file

@ -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;
}