From 51aada2a6f2cacf0134e14bd6559bc71c746c4a5 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sun, 28 Apr 2019 14:13:25 +0300 Subject: tdf#120703 PVS: dereference before nullptr check V595 The 'mpViewShell' pointer was utilized before it was verified against nullptr. Check lines: 96, 125. Change-Id: I824c6cf8a5ed7f0ef20e99df36c83feec7fe54ea Reviewed-on: https://gerrit.libreoffice.org/71468 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- sd/source/ui/view/drtxtob1.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sd') diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 4cfe98f8431a..629cecbecfd3 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -92,6 +92,8 @@ void TextObjectBar::Execute( SfxRequest &rReq ) std::unique_ptr> aGuard; + assert(mpViewShell); + if( dynamic_cast< const OutlineView *>( mpView ) != nullptr) { pOLV = static_cast(mpView) @@ -124,7 +126,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) } else { - if( mpViewShell && mpViewShell->GetViewFrame() ) + if (mpViewShell->GetViewFrame()) mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_STYLE_DESIGNER, SfxCallMode::ASYNCHRON ); } -- cgit