diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-10-22 09:04:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-10-22 16:45:05 +0100 |
commit | c4e1857dc034d38900f8a7ef0a10814911e91e59 (patch) | |
tree | 82150f4a2d4e7b9640a8ea881abfb55fc75e6584 /sfx2/source/appl/appbas.cxx | |
parent | 69eaba2e9b2269e18145cc663cf0e503b85a5a6d (diff) |
coverity#441226 Dereference null return value
Change-Id: Ib80e5f5d9e41c6511779e7a956cdba9b856c25ba
Diffstat (limited to 'sfx2/source/appl/appbas.cxx')
-rw-r--r-- | sfx2/source/appl/appbas.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
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<SfxUInt16Item>(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<SfxUInt16Item>(nSID)) + { + std::shared_ptr< comphelper::ConfigurationChanges > batch( + comphelper::ConfigurationChanges::create()); + officecfg::Office::Common::Undo::Steps::set( + pCountItem->GetValue(), batch); + batch->commit(); + } break; } |