diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-03-11 10:22:11 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-03-11 14:08:38 +0000 |
commit | 58a48aceb289d4d9ccef4f8652d2a41a567e23e9 (patch) | |
tree | fb0f7c4a3d3ac1b38072d8f12d88f1ae81f5ff5d /sd | |
parent | dc23633610a80dcbd978c8c368d7520f0436227f (diff) |
V595: pointer was utilized before it was verified against nullptr
Change-Id: I271e045ed2f80e648d620f26cd60215f7f806bd1
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/unoidl/unocpres.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sd/source/ui/unoidl/unocpres.cxx b/sd/source/ui/unoidl/unocpres.cxx index c8f1c76553d7..0d182b3b295d 100644 --- a/sd/source/ui/unoidl/unocpres.cxx +++ b/sd/source/ui/unoidl/unocpres.cxx @@ -196,19 +196,16 @@ uno::Any SAL_CALL SdXCustomPresentation::getByIndex( sal_Int32 Index ) if( bDisposing ) throw lang::DisposedException(); - if( Index < 0 || Index >= (sal_Int32)mpSdCustomShow->PagesVector().size() ) + if (Index < 0 || !mpSdCustomShow || Index >= (sal_Int32)mpSdCustomShow->PagesVector().size()) throw lang::IndexOutOfBoundsException(); uno::Any aAny; - if(mpSdCustomShow ) - { - SdrPage* pPage = (SdrPage*)mpSdCustomShow->PagesVector()[Index]; + SdrPage* pPage = (SdrPage*)mpSdCustomShow->PagesVector()[Index]; - if( pPage ) - { - uno::Reference< drawing::XDrawPage > xRef( pPage->getUnoPage(), uno::UNO_QUERY ); - aAny <<= xRef; - } + if( pPage ) + { + uno::Reference< drawing::XDrawPage > xRef( pPage->getUnoPage(), uno::UNO_QUERY ); + aAny <<= xRef; } return aAny; |