summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls/StylesPreviewWindow.cxx
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-06-18 09:55:44 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2020-07-03 07:39:22 +0200
commitf6f5fa8038e1b8e320a8e74af1c5d901d13988a5 (patch)
tree35592b803a4cc577c294476e906a8aa321650b07 /svx/source/tbxctrls/StylesPreviewWindow.cxx
parent7dc3a20cab712ee987ea25a8f5728529521485b7 (diff)
Styles preview: avoid nullptr dereference
Change-Id: I04292baa8a680f03613cef32f7cb55581b914809 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96935 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97745 Tested-by: Jenkins
Diffstat (limited to 'svx/source/tbxctrls/StylesPreviewWindow.cxx')
-rw-r--r--svx/source/tbxctrls/StylesPreviewWindow.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/svx/source/tbxctrls/StylesPreviewWindow.cxx b/svx/source/tbxctrls/StylesPreviewWindow.cxx
index 5f4749d2a53a..43d3b140cb35 100644
--- a/svx/source/tbxctrls/StylesPreviewWindow.cxx
+++ b/svx/source/tbxctrls/StylesPreviewWindow.cxx
@@ -205,6 +205,9 @@ static SvxFont GetFontFromItems(const SvxFontItem* pFontItem, Size aPixelFontSiz
void StyleItemController::DrawEntry(vcl::RenderContext& rRenderContext)
{
SfxObjectShell* pShell = SfxObjectShell::Current();
+ if (!pShell)
+ return;
+
SfxStyleSheetBasePool* pPool = pShell->GetStyleSheetPool();
SfxStyleSheetBase* pStyle = nullptr;