From c4e1857dc034d38900f8a7ef0a10814911e91e59 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 22 Oct 2015 09:04:41 +0100 Subject: coverity#441226 Dereference null return value Change-Id: Ib80e5f5d9e41c6511779e7a956cdba9b856c25ba --- sfx2/source/appl/appbas.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'sfx2/source') diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx index 1a4365bb37f8..085d7885cf03 100644 --- a/sfx2/source/appl/appbas.cxx +++ b/sfx2/source/appl/appbas.cxx @@ -152,12 +152,14 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq ) { case SID_ATTR_UNDO_COUNT: { - const SfxUInt16Item* pCountItem = rReq.GetArg(nSID); - std::shared_ptr< comphelper::ConfigurationChanges > batch( - comphelper::ConfigurationChanges::create()); - officecfg::Office::Common::Undo::Steps::set( - pCountItem->GetValue(), batch); - batch->commit(); + if (const SfxUInt16Item* pCountItem = rReq.GetArg(nSID)) + { + std::shared_ptr< comphelper::ConfigurationChanges > batch( + comphelper::ConfigurationChanges::create()); + officecfg::Office::Common::Undo::Steps::set( + pCountItem->GetValue(), batch); + batch->commit(); + } break; } -- cgit