diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-05-27 16:16:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-05-27 20:57:05 +0200 |
commit | fc1eb075a5bbddebd3359dae79713af3094bfd38 (patch) | |
tree | 87b99a3537e5cee12d202a185de96ccbaf621cca /sc | |
parent | 2743839c4ac3aaaf6bafc31bebfb67254173f7ee (diff) |
cid#1531780 Dereference null return value
Change-Id: I4aa66284b0a9948cd947cc99a119ce4ea2bbf26e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152342
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/oox/autofilterbuffer.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sc/source/filter/oox/autofilterbuffer.cxx b/sc/source/filter/oox/autofilterbuffer.cxx index 8c8050509f38..9fa6de21d46b 100644 --- a/sc/source/filter/oox/autofilterbuffer.cxx +++ b/sc/source/filter/oox/autofilterbuffer.cxx @@ -440,10 +440,12 @@ ApiFilterSettings ColorFilter::finalizeImport() const SfxItemSet& rItemSet = pStyleSheet->GetItemSet(); // Color (whether text or background color) is always stored in ATTR_BACKGROUND - const SvxBrushItem* pItem = rItemSet.GetItem<SvxBrushItem>(ATTR_BACKGROUND); - ::Color aColor = pItem->GetFiltColor(); - util::Color nColor(aColor); - aSettings.appendField(true, nColor, mbIsBackgroundColor); + if (const SvxBrushItem* pItem = rItemSet.GetItem<SvxBrushItem>(ATTR_BACKGROUND)) + { + ::Color aColor = pItem->GetFiltColor(); + util::Color nColor(aColor); + aSettings.appendField(true, nColor, mbIsBackgroundColor); + } return aSettings; } |