* InsetExternal.cpp:

* GuiExternal.cpp:
	- do not crash if the list of external templates is empty (bug #3974).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31569 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2009-10-09 12:40:34 +00:00
parent 2c6f0ae445
commit 5f982b8c83
2 changed files with 4 additions and 1 deletions

View File

@ -80,6 +80,8 @@ char const * const origin_gui_strs[] = {
external::Template getTemplate(int i)
{
if (external::TemplateManager::get().getTemplates().empty())
return Template();
external::TemplateManager::Templates::const_iterator i1
= external::TemplateManager::get().getTemplates().begin();
advance(i1, i);

View File

@ -104,7 +104,8 @@ InsetExternalParams::InsetExternalParams()
if (defaultTemplateName.empty()) {
external::TemplateManager const & etm =
external::TemplateManager::get();
templatename_ = etm.getTemplates().begin()->first;
if (!etm.getTemplates().empty())
templatename_ = etm.getTemplates().begin()->first;
} else
templatename_ = defaultTemplateName;
}