From 58a48aceb289d4d9ccef4f8652d2a41a567e23e9 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 11 Mar 2015 10:22:11 +0000 Subject: V595: pointer was utilized before it was verified against nullptr Change-Id: I271e045ed2f80e648d620f26cd60215f7f806bd1 --- sd/source/ui/unoidl/unocpres.cxx | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'sd') 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; -- cgit