]> git.lyx.org Git - lyx.git/blobdiff - src/text.C
Fix potential crashes related to element presence in a given map.
[lyx.git] / src / text.C
index 94178761626a06c227ab07bbcfc6a834e48a64b5..da326879c5cc2c15f1fddf8e00f71e23b5337bc0 100644 (file)
@@ -2245,6 +2245,9 @@ int LyXText::cursorY(CursorSlice const & sl, bool boundary) const
 {
        //lyxerr << "LyXText::cursorY: boundary: " << boundary << std::endl;
        Paragraph const & par = getPar(sl.pit());
+       if (par.rows().empty())
+               return 0;
+
        int h = 0;
        h -= pars_[0].rows()[0].ascent();
        for (pit_type pit = 0; pit < sl.pit(); ++pit)