Skip to content

Commit f2f1426

Browse files
committed
Catch xml import error for composition
1 parent 3a1c9ef commit f2f1426

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/core/composer/qgscomposition.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,13 @@ bool QgsComposition::loadFromTemplate( const QDomDocument& doc, QMap<QString, QS
379379
{
380380
xmlString = xmlString.replace( "[" + sIt.key() + "]", encodeStringForXML( sIt.value() ) );
381381
}
382-
importDoc.setContent( xmlString );
382+
383+
QString errorMsg;
384+
int errorLine, errorColumn;
385+
if ( !importDoc.setContent( xmlString, &errorMsg, &errorLine, &errorColumn ) )
386+
{
387+
return false;
388+
}
383389
}
384390
else
385391
{

0 commit comments

Comments
 (0)