diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-07-09 09:57:21 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-07-09 13:00:24 +0200 |
commit | 1f66b4247334d253c7237ed5447e5f72716c4897 (patch) | |
tree | 63d462e1544f7571bc931a0ae63f25693209e5f8 | |
parent | 9ff9ad072e4e38e55b75f5b05d40b72c58e47a28 (diff) |
cid#1465234 Unchecked return value
Change-Id: I56d59de5c65144283595b044142ff3f8988a02a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98409
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | svx/source/form/navigatortree.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index 77300a01b662..70d1e713ac40 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -1895,8 +1895,10 @@ namespace svxform if ((m_arrCurrentSelection.size() == 1) && (m_nFormsSelected == 1)) { std::unique_ptr<weld::TreeIter> xSelected(m_xTreeView->make_iterator()); - m_xTreeView->get_selected(xSelected.get()); - FmFormData* pSingleSelectionData = dynamic_cast<FmFormData*>(reinterpret_cast<FmEntryData*>(m_xTreeView->get_id(*xSelected).toInt64())); + if (!m_xTreeView->get_selected(xSelected.get())) + xSelected.reset(); + FmFormData* pSingleSelectionData = xSelected ? dynamic_cast<FmFormData*>(reinterpret_cast<FmEntryData*>(m_xTreeView->get_id(*xSelected).toInt64())) + : nullptr; DBG_ASSERT( pSingleSelectionData, "NavigatorTree::SynchronizeMarkList: invalid selected form!" ); if ( pSingleSelectionData ) { |