summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdf_dataavail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/fpdf_dataavail.cpp')
-rw-r--r--fpdfsdk/src/fpdf_dataavail.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/fpdfsdk/src/fpdf_dataavail.cpp b/fpdfsdk/src/fpdf_dataavail.cpp
index 63f9b4cec0..9fe2fa82b1 100644
--- a/fpdfsdk/src/fpdf_dataavail.cpp
+++ b/fpdfsdk/src/fpdf_dataavail.cpp
@@ -141,9 +141,7 @@ FPDFAvail_GetDocument(FPDF_AVAIL avail, FPDF_BYTESTRING password) {
DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc) {
CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(doc);
- if (!doc)
- return 0;
- return ((CPDF_Parser*)pDoc->GetParser())->GetFirstPageNo();
+ return pDoc ? pDoc->GetParser()->GetFirstPageNo() : 0;
}
DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail,