]> git.sesse.net Git - kdenlive/commitdiff
make sure we don't trash the project file if something is wrong in MLT, see issue:
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 8 Feb 2010 18:44:15 +0000 (18:44 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 8 Feb 2010 18:44:15 +0000 (18:44 +0000)
http://www.kdenlive.org/mantis/view.php?id=1427

svn path=/trunk/kdenlive/; revision=4302

src/kdenlivedoc.cpp

index 4c672235bb54fe085adab77461d281ee7cad1de1..5c889404c04a886b89285942296d09b0331f2e45 100644 (file)
@@ -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);