From 72a08a55791a1c17c0ec15b2ab5c7294c23e2831 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 8 Jan 2023 21:21:13 +0000 Subject: tdf#152931 deref of moPenColor std::optional on launching writer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I13cb7aade5b4a0142e23bd62e62d2160c73d8740 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145180 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- vcl/unx/generic/gdi/gdiimpl.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vcl/unx/generic/gdi') diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx index 4b3b128b7442..7f8672f07735 100644 --- a/vcl/unx/generic/gdi/gdiimpl.cxx +++ b/vcl/unx/generic/gdi/gdiimpl.cxx @@ -152,8 +152,8 @@ X11SalGraphicsImpl::~X11SalGraphicsImpl() void X11SalGraphicsImpl::Init() { - mnPenPixel = mrParent.GetPixel( *moPenColor ); - mnBrushPixel = mrParent.GetPixel( *moBrushColor ); + mnPenPixel = moPenColor ? mrParent.GetPixel(*moPenColor) : 0; + mnBrushPixel = moBrushColor ? mrParent.GetPixel(*moBrushColor) : 0; } XID X11SalGraphicsImpl::GetXRenderPicture() -- cgit