]> git.lyx.org Git - lyx.git/commitdiff
Fix bug #7553 (Crash on latex import, also on html import)
authorEnrico Forestieri <forenr@lyx.org>
Thu, 12 May 2011 23:08:50 +0000 (23:08 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Thu, 12 May 2011 23:08:50 +0000 (23:08 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38734 a592a061-630c-0410-9148-cb99ea01b6c8

src/Converter.cpp

index 8adcfc32589a3e986aa1ac661dd6a3be215f0c30..1e3b15c3806bee659db9b83e1f085ba4496ce90e 100644 (file)
@@ -307,7 +307,8 @@ bool Converters::convert(Buffer const * buffer,
                        LYXERR(Debug::FILES, "No converter defined! "
                                   "I use convertDefault.py:\n\t" << command);
                        Systemcall one;
-                       one.startscript(Systemcall::Wait, command, buffer->filePath());
+                       one.startscript(Systemcall::Wait, command, buffer ?
+                                       buffer->filePath() : string());
                        if (to_file.isReadableFile()) {
                                if (conversionflags & try_cache)
                                        ConverterCache::get().add(orig_from,
@@ -444,13 +445,14 @@ bool Converters::convert(Buffer const * buffer,
                        if (dummy) {
                                res = one.startscript(Systemcall::DontWait,
                                        to_filesystem8bit(from_utf8(command)),
-                                       buffer->filePath());
+                                       buffer ? buffer->filePath() : string());
                                // We're not waiting for the result, so we can't do anything
                                // else here.
                        } else {
                                res = one.startscript(Systemcall::Wait,
                                                to_filesystem8bit(from_utf8(command)),
-                                               buffer->filePath());
+                                               buffer ? buffer->filePath()
+                                                      : string());
                                if (!real_outfile.empty()) {
                                        Mover const & mover = getMover(conv.to);
                                        if (!mover.rename(outfile, real_outfile))