erase history would crash with empty reslist docsource
This commit is contained in:
parent
a029ca8699
commit
713eb87472
@ -1062,10 +1062,12 @@ void RclMain::showDocHistory()
|
|||||||
void RclMain::eraseDocHistory()
|
void RclMain::eraseDocHistory()
|
||||||
{
|
{
|
||||||
// Clear file storage
|
// Clear file storage
|
||||||
g_dynconf->eraseAll(RclHistory::docSubkey);
|
if (g_dynconf)
|
||||||
|
g_dynconf->eraseAll(RclHistory::docSubkey);
|
||||||
// Clear possibly displayed history
|
// Clear possibly displayed history
|
||||||
if (resList->displayingHistory())
|
if (resList->displayingHistory()) {
|
||||||
showDocHistory();
|
showDocHistory();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when the uiprefs dialog is ok'd
|
// Called when the uiprefs dialog is ok'd
|
||||||
|
|||||||
@ -178,6 +178,8 @@ bool ResList::displayingHistory()
|
|||||||
// We want to reset the displayed history if it is currently
|
// We want to reset the displayed history if it is currently
|
||||||
// shown. Using the title value is an ugly hack
|
// shown. Using the title value is an ugly hack
|
||||||
string htstring = string((const char *)tr("Document history").utf8());
|
string htstring = string((const char *)tr("Document history").utf8());
|
||||||
|
if (m_docSource.isNull() || m_docSource->title().empty())
|
||||||
|
return false;
|
||||||
return m_docSource->title().find(htstring) == 0;
|
return m_docSource->title().find(htstring) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user