]> git.lyx.org Git - features.git/commitdiff
Fix crash due to invalid pos
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 20 May 2014 09:14:13 +0000 (11:14 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Tue, 20 May 2014 09:14:13 +0000 (11:14 +0200)
src/output_latex.cpp

index 4f8f14a86a75d9f3e32b4ebee63bd0a1cb3f7c42..1f47ca73a1d909cab111e8e0ef6867604d3be39c 100644 (file)
@@ -872,7 +872,7 @@ void TeXOnePar(Buffer const & buf,
        default:
                // we don't need it for the last paragraph!!!
                // or if the last thing is an environment separator
-               if (nextpar && !par.isEnvSeparator(par.size() - 1))
+               if (nextpar && par.size() > 0 && !par.isEnvSeparator(par.size() - 1))
                        pending_newline = true;
        }
 
@@ -1018,7 +1018,7 @@ void TeXOnePar(Buffer const & buf,
        // we don't need a newline for the last paragraph!!!
        // Note from JMarc: we will re-add a \n explicitly in
        // TeXEnvironment, because it is needed in this case
-       if (nextpar && !par.isEnvSeparator(par.size() - 1)) {
+       if (nextpar && par.size() > 0 && !par.isEnvSeparator(par.size() - 1)) {
                // Make sure to start a new line
                os << breakln;
                Layout const & next_layout = nextpar->layout();