Commit a565c620 authored by Gopalakrishna Bhat A's avatar Gopalakrishna Bhat A
Browse files

Check if the list is actually stored in KoTextDocument before accessing it.

BUG: 291858
parent 75dd8aab
......@@ -1407,7 +1407,7 @@ QTextBlock& KoTextWriter::Private::saveList(QTextBlock &block, QHash<QTextList *
listTagInformation.setTagName("text:list");
listTagInformation.addAttribute("text:style-name", listStyles[textList]);
if (listXmlIds.contains(list->listContinuedFrom())) {
if (list && listXmlIds.contains(list->listContinuedFrom())) {
listTagInformation.addAttribute("text:continue-list", listXmlIds.value(list->listContinuedFrom()));
}
......
......@@ -260,7 +260,7 @@ void ListItemsHelper::recalculateBlock(QTextBlock &block)
if (!fixed) {
//if this is the first item then find if the list has to be continued from any other list
KoList *listContinued = 0;
if (m_textList->itemNumber(block) == 0 && (listContinued = KoTextDocument(m_textList->document()).list(m_textList)->listContinuedFrom())) {
if (m_textList->itemNumber(block) == 0 && KoTextDocument(m_textList->document()).list(m_textList) && (listContinued = KoTextDocument(m_textList->document()).list(m_textList)->listContinuedFrom())) {
//find the previous list of the same level
QTextList *previousTextList = listContinued->textLists().at(level - 1).data();
if (previousTextList) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment