                    "Attempt to delete page at \(index) but there are \(newPageCount) pages after the update")
             
             let sanitizedIndex = min(index, newPageCount)
+            guard let currentIndex = self.currentIndex else {
+                return
+            }
             guard let newViewController = dataSource?.viewController(for: self, at: sanitizedIndex) else {
                 return
             }

            guard let currentIndex = self.currentIndex else {
                return
            }
            
            guard let newViewController = dataSource?.viewController(for: self, at: index) else {
                assertionFailure("Expected to find inserted UIViewController at page \(index)")
                return

                }
                
                // Reload current view controller in UIPageViewController if insertion index is next/previous page.
                if pageIndex(index, isNextTo: currentIndex) {
                    guard let currentViewController = self.currentViewController else {
                        return
                    }
