From 0e30ed655c6c893502bfc3de26427d0b99857561 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 10 Jun 2020 15:53:56 +0100 Subject: Resolves: tdf#133862 crash in customize toolbar in embedded math Change-Id: I2fc7f3620145e48516c3ca73c0a5d08dce11d78a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96035 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- cui/source/customize/SvxNotebookbarConfigPage.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'cui/source/customize') diff --git a/cui/source/customize/SvxNotebookbarConfigPage.cxx b/cui/source/customize/SvxNotebookbarConfigPage.cxx index c8270b941385..198a19f57782 100644 --- a/cui/source/customize/SvxNotebookbarConfigPage.cxx +++ b/cui/source/customize/SvxNotebookbarConfigPage.cxx @@ -433,6 +433,8 @@ void SvxNotebookbarConfigPage::SelectElement() OString sUIFileUIPath = CustomNotebookbarGenerator::getSystemPath( CustomNotebookbarGenerator::getCustomizedUIPath()); xmlDocPtr pDoc = xmlParseFile(sUIFileUIPath.getStr()); + if (!pDoc) + return; xmlNodePtr pNodePtr = xmlDocGetRootElement(pDoc); std::vector aEntries; @@ -494,10 +496,7 @@ void SvxNotebookbarConfigPage::SelectElement() aEntries.clear(); - if (pDoc != nullptr) - { - xmlFreeDoc(pDoc); - } + xmlFreeDoc(pDoc); } SvxNotebookbarEntriesListBox::SvxNotebookbarEntriesListBox(std::unique_ptr xParent, -- cgit