From 46a02c988454c5c29943475a7b44bc0bdafefb55 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 11 Jun 2020 08:52:57 +1000 Subject: Backport: Avoid warning for potential nullptr dereference that is not actually possible. Backport of changeset 8298:95489a5b6e62. --- win32/ScintillaWin.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 651a2629f..668a450a8 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -3517,8 +3517,10 @@ LRESULT PASCAL ScintillaWin::CTWndProc( } // If above SUCCEEDED, then pCTRenderTarget not nullptr assert(pCTRenderTarget); - surfaceWindow->Init(pCTRenderTarget, hWnd); - pCTRenderTarget->BeginDraw(); + if (pCTRenderTarget) { + surfaceWindow->Init(pCTRenderTarget, hWnd); + pCTRenderTarget->BeginDraw(); + } #endif } surfaceWindow->SetUnicodeMode(SC_CP_UTF8 == sciThis->ct.codePage); -- cgit v1.2.3