In rare cases SourceErrorFormat is called wihtout position and hides the original error

This commit is contained in:
Panayot Cankov
2016-01-08 16:58:03 +02:00
parent 605385c0b2
commit dfdcc91eea

View File

@ -213,7 +213,7 @@ namespace xml2ui {
export function SourceErrorFormat(uri): ErrorFormatter {
return (e: Error, p: xml.Position) => {
var source = new Source(uri, p.line, p.column);
var source = p ? new Source(uri, p.line, p.column) : new Source(uri, -1, -1);
e = new SourceError(e, source, "Building UI from XML.");
return e;
}