cid#1465669 Dereference after null check

SwXTextDocument::GetRenderDoc already uncondionally dereferences
pDocShell so we can assume its non null

Change-Id: I25edd2415ff052b1bdaa6d6a6d1a252a12b14100
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100289
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2020-08-07 09:18:32 +01:00
parent 04d116fe90
commit 7c399dabb2

View File

@@ -2929,9 +2929,7 @@ void SAL_CALL SwXTextDocument::render(
throw IllegalArgumentException();
// tdf#135244: prevent jumping to cursor at any temporary modification
decltype(pDocShell->LockAllViews()) aLock;
if (pDocShell)
aLock = pDocShell->LockAllViews();
auto aLock = pDocShell->LockAllViews();
const bool bHasPDFExtOutDevData = lcl_SeqHasProperty( rxOptions, "HasPDFExtOutDevData" );
const bool bIsPDFExport = !lcl_SeqHasProperty( rxOptions, "IsPrinter" ) || bHasPDFExtOutDevData;