Kaydet (Commit) 0beb64bf authored tarafından Noel Grandin's avatar Noel Grandin

cid#736789 dereference before null check

Change-Id: I657880e7ed37f9933efcfc110daae8b4c4791497
üst 4d15e903
......@@ -1171,15 +1171,12 @@ SdrPage* ScShapeChildren::GetDrawPage() const
{
SCTAB nTab( mpViewShell->GetLocationData().GetPrintTab() );
SdrPage* pDrawPage = NULL;
if (mpViewShell)
ScDocument* pDoc = mpViewShell->GetDocument();
if (pDoc && pDoc->GetDrawLayer())
{
ScDocument* pDoc = mpViewShell->GetDocument();
if (pDoc && pDoc->GetDrawLayer())
{
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
if (pDrawLayer->HasObjects() && (pDrawLayer->GetPageCount() > nTab))
pDrawPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(static_cast<sal_Int16>(nTab)));
}
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
if (pDrawLayer->HasObjects() && (pDrawLayer->GetPageCount() > nTab))
pDrawPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(static_cast<sal_Int16>(nTab)));
}
return pDrawPage;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment