From 5db7753f7be69a4c2fa6bd998f169c7b09cc772b Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Mon, 19 Feb 2007 12:38:31 +0000 Subject: [PATCH] Don't use an uninitialized variable git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17255 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/buffer_funcs.C | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/buffer_funcs.C b/src/buffer_funcs.C index d1b0e76b56..5f1b6259b7 100644 --- a/src/buffer_funcs.C +++ b/src/buffer_funcs.C @@ -550,7 +550,7 @@ void setLabel(Buffer const & buf, ParIterator & it, LyXTextClass const & textcla } else if (layout->labeltype == LABEL_SENSITIVE) { // Search for the first float or wrap inset in the iterator size_t i = it.depth(); - InsetBase * in; + InsetBase * in = 0; while (i > 0) { --i; in = &it[i].inset(); @@ -558,7 +558,9 @@ void setLabel(Buffer const & buf, ParIterator & it, LyXTextClass const & textcla || in->lyxCode() == InsetBase::WRAP_CODE) break; } - docstring const & type = in->getInsetName(); + docstring type; + if (in) + type = in->getInsetName(); if (!type.empty()) { Floating const & fl = textclass.floats().getType(to_ascii(type)); -- 2.39.2