From b16f2e3a39255dcb3e8cb064c81f6d2b33efb9cb Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Apr 2022 14:20:11 +0100 Subject: cid#1503836 silence Dereference null return value (cherry picked from commit 64046625553ecbfd9fe0661e5b6f48e283a909e0) Change-Id: I11dae0872d1f4add67b59ffd9696134c1dd2dbea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136750 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna --- sd/source/ui/view/drviews2.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sd/source') diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 9918368dda65..02a3e3364c1c 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -597,8 +597,9 @@ public: if (nSlot == SID_ATTR_FILL_COLOR) { // Merge the color parameters to the color itself. - XFillColorItem aColorItem( - *static_cast(pArgs->GetItem(SID_ATTR_FILL_COLOR))); + const XFillColorItem* pColorItem = static_cast(pArgs->GetItem(SID_ATTR_FILL_COLOR)); + assert(pColorItem); + XFillColorItem aColorItem(*pColorItem); if (pArgs->GetItemState(SID_ATTR_COLOR_THEME_INDEX, false, &pItem) == SfxItemState::SET) { auto pIntItem = static_cast(pItem); -- cgit