diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-12-12 09:10:39 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-12-12 09:11:11 +0000 |
commit | 221a3413af1b0f86a78c141fb2ea8fe969911dfb (patch) | |
tree | c80c5b6bc88b458535e74347d90319b5c2563794 | |
parent | 3249009bb77933fe1c3402f5f2110048753c8a66 (diff) |
coverity#1397056 Dereference null return value
Change-Id: Ieda3afdbdbcc8aa21f6584edc21738c4edb84000
-rw-r--r-- | svtools/source/contnr/treelistbox.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index 230b90d931b4..67d8e95ea21a 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -1844,12 +1844,15 @@ void SvTreeListBox::SetCheckButtonState( SvTreeListEntry* pEntry, SvButtonState void SvTreeListBox::SetCheckButtonInvisible( SvTreeListEntry* pEntry) { - if( nTreeFlags & SvTreeFlags::CHKBTN ) - { - SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SvLBoxItemType::Button)); - pItem->SetStateInvisible(); - InvalidateEntry( pEntry ); - } + SvLBoxButton* pItem = (nTreeFlags & SvTreeFlags::CHKBTN) ? + static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SvLBoxItemType::Button)) : + nullptr; + + if (!pItem) + return; + + pItem->SetStateInvisible(); + InvalidateEntry(pEntry); } SvButtonState SvTreeListBox::GetCheckButtonState( SvTreeListEntry* pEntry ) const |