diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-09-27 09:02:38 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-09-27 17:29:46 +0200 |
commit | 572bd797719e21d84b20a4eaaa3a98f068214c2b (patch) | |
tree | 9a0965c2a4c0f8a931b3eb277c809e523c3ad3d0 /cui | |
parent | 86cca6b40ced4031dec4b708ac67b5cbe70cddf9 (diff) |
cid#1453996 Unchecked return value
Change-Id: I0b5010aec8ad941d662e851833923a8b6b0a383d
Reviewed-on: https://gerrit.libreoffice.org/79672
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/treeopt.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index e801425ad7a9..4165f2dfb5b3 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -575,15 +575,14 @@ OfaTreeOptionsDialog::~OfaTreeOptionsDialog() OptionsPageInfo* OfaTreeOptionsDialog::AddTabPage( sal_uInt16 nId, const OUString& rPageName, sal_uInt16 nGroup ) { - OptionsPageInfo* pPageInfo = new OptionsPageInfo( nId ); - std::unique_ptr<weld::TreeIter> xParent = xTreeLB->make_iterator(); - xTreeLB->get_iter_first(*xParent); + if (!xTreeLB->get_iter_first(*xParent)) + return nullptr; xTreeLB->iter_nth_sibling(*xParent, nGroup); + OptionsPageInfo* pPageInfo = new OptionsPageInfo( nId ); OUString sId(OUString::number(reinterpret_cast<sal_Int64>(pPageInfo)));; xTreeLB->insert(xParent.get(), -1, &rPageName, &sId, nullptr, nullptr, nullptr, false, nullptr); - return pPageInfo; } |