diff --git a/vcl/skia/osx/gdiimpl.cxx b/vcl/skia/osx/gdiimpl.cxx index 752208c0bc41..c4bd75184242 100644 --- a/vcl/skia/osx/gdiimpl.cxx +++ b/vcl/skia/osx/gdiimpl.cxx @@ -224,6 +224,11 @@ bool AquaSkiaSalGraphicsImpl::drawNativeControl(ControlType nType, ControlPart n const tools::Rectangle& rControlRegion, ControlState nState, const ImplControlValue& aValue) { + // tdf#157613 make sure surface is not a nullptr + checkSurface(); + if (!mSurface) + return false; + // rControlRegion is not the whole area that the control should be painted to (e.g. highlight // around focused lineedit is outside of it). Since we draw to a temporary bitmap, we need tofind out // the real size. Using getNativeControlRegion() might seem like the function to call, but we need