From 833519f6385c2293ba35d9901bce01cd62bb0505 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 10 Sep 2002 11:50:13 +0000 Subject: [PATCH] fix crash in navigate menu git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5248 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/MenuBackend.C | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index d22d3c724b..52d277e58a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-09-10 Jean-Marc Lasgouttes + + * MenuBackend.C (expandToc): fix crash when there is no document + open + 2002-09-10 Dekel Tsur * many files: Add insetwrap. diff --git a/src/MenuBackend.C b/src/MenuBackend.C index f3f7fff25a..2af19defcb 100644 --- a/src/MenuBackend.C +++ b/src/MenuBackend.C @@ -480,6 +480,12 @@ void expandToc2(Menu & tomenu, toc::Toc const & toc_list, void expandToc(Menu & tomenu, Buffer const * buf) { + if (!buf) { + tomenu.add(MenuItem(MenuItem::Command, + _("No Documents Open!"), LFUN_NOACTION)); + return; + } + FloatList const & floats = buf->params.getLyXTextClass().floats(); toc::TocList toc_list = toc::getTocList(buf); toc::TocList::const_iterator cit = toc_list.begin();