diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-08-07 09:47:21 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-08-07 20:46:12 +0200 |
commit | d7d09fd881ff56ea1a7b6863cafb298387f20f98 (patch) | |
tree | bd42d1aeaf9a8f4912ba0723e69b397378622783 /dbaccess/source | |
parent | e5e66dcee74da4f8b91a29b21b744f7aed138f1c (diff) |
cid#1465673 Unchecked return value
Change-Id: I6213d9c0f0450b5e600553c18deb5fbef3a05230
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100295
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess/source')
-rw-r--r-- | dbaccess/source/ui/querydesign/ConnectionLine.cxx | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/dbaccess/source/ui/querydesign/ConnectionLine.cxx b/dbaccess/source/ui/querydesign/ConnectionLine.cxx index 791f89247a52..5411e22e9457 100644 --- a/dbaccess/source/ui/querydesign/ConnectionLine.cxx +++ b/dbaccess/source/ui/querydesign/ConnectionLine.cxx @@ -82,13 +82,20 @@ namespace { const OTableWindowListBox* pListBox = _pWin->GetListBox(); _rNewConPos.setY( _pWin->GetPosPixel().Y() ); + + std::unique_ptr<weld::TreeIter> xEntry; + const weld::TreeView& rTreeView = pListBox->get_widget(); + if (_nEntry != -1) { _rNewConPos.AdjustY(pListBox->GetPosPixel().Y() ); - const weld::TreeView& rTreeView = pListBox->get_widget(); - std::unique_ptr<weld::TreeIter> xEntry = rTreeView.make_iterator(); - rTreeView.get_iter_first(*xEntry); - rTreeView.iter_nth_sibling(*xEntry, _nEntry); + xEntry = rTreeView.make_iterator(); + if (!rTreeView.get_iter_first(*xEntry) || !rTreeView.iter_nth_sibling(*xEntry, _nEntry)) + xEntry.reset(); + } + + if (xEntry) + { auto nEntryPos = rTreeView.get_row_area(*xEntry).Center().Y(); if( nEntryPos >= 0 ) |