make sure we don't trash the project file if something is wrong in MLT, see issue:

http://www.kdenlive.org/mantis/view.php?id=1427

svn path=/trunk/kdenlive/; revision=4302
parent 75112d0c
......@@ -481,6 +481,11 @@ bool KdenliveDoc::saveSceneList(const QString &path, const QString &scene)
QDomDocument sceneList;
sceneList.setContent(scene, true);
QDomElement mlt = sceneList.firstChildElement("mlt");
if (mlt.isNull() || !mlt.hasChildNodes()) {
//Make sure we don't save if scenelist is corrupted
KMessageBox::error(kapp->activeWindow(), i18n("Cannot write to file %1", path));
return false;
}
QDomElement addedXml = sceneList.createElement("kdenlivedoc");
mlt.appendChild(addedXml);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment