Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Implement error handling for QXmlStreamReader in SvgParser

Dmitry Kazakov2b4167486491
diff --git a/libs/flake/svg/SvgParser.cpp b/libs/flake/svg/SvgParser.cpp
index e4aab64a70..62addad05c 100644
--- a/libs/flake/svg/SvgParser.cpp
+++ b/libs/flake/svg/SvgParser.cpp
@@ -204,9 +204,11 @@ QDomDocument SvgParser::createDocumentFromSvg(QXmlStreamReader reader, QString *
#else
QDomDocument::ParseResult result = doc.setContent(&reader, QDomDocument::ParseOption::PreserveSpacingOnlyNodes);
if (!result) {
- //*errorMsg = result.errorMessage;
- //*errorLine = result.errorLine;
- //*errorColumn = result.errorColumn;
+ if (errorMsg && errorLine && errorColumn) {
+ *errorMsg = result.errorMessage;
+ *errorLine = result.errorLine;
+ *errorColumn = result.errorColumn;
+ }
return {};
}
#endif