From 45e1c90736187a1befc6dd5037ed7d122f504576 Mon Sep 17 00:00:00 2001 From: colman marcus-quinn Date: Tue, 17 Jan 2017 15:30:08 +0100 Subject: [PATCH] Update CPDFDocumentViewController.m --- Source/PDF UI/CPDFDocumentViewController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/PDF UI/CPDFDocumentViewController.m b/Source/PDF UI/CPDFDocumentViewController.m index 6010012..9f7b69e 100644 --- a/Source/PDF UI/CPDFDocumentViewController.m +++ b/Source/PDF UI/CPDFDocumentViewController.m @@ -529,7 +529,7 @@ - (UIViewController *)pageViewController:(UIPageViewController *)pageViewControl CPDFPageViewController *theViewController = (CPDFPageViewController *)viewController; NSUInteger theNextPageNumber = theViewController.page.pageNumber + 1; - if (theNextPageNumber > self.document.numberOfPages) + if (theNextPageNumber > self.document.numberOfPages || theViewController.page.pageNumber == 0) { //thealch3m1st: if we are in two page mode and the document has an even number of pages if it would just return NULL it woudln't flip to that last page so we have to return a an empty page for the (number of pages + 1)th page. if(self.document.numberOfPages %2 == 0 &&