mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 10:18:50 +00:00
* 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:
parent
2c6f0ae445
commit
5f982b8c83
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user