Skip to content

Commit 02a65cf

Browse files
authored
Merge pull request #833 from rhulha/master
Fixed an "Undefined array key -1" Warning
2 parents 0031d0f + 606a83d commit 02a65cf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/MyPdf.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,8 +1405,10 @@ public function createIndex(
14051405
$size=sizeof($this->outlines);
14061406

14071407
// get the size of the "P. xx" cell
1408-
$pageCellSize=$this->GetStringWidth('p. '.$this->outlines[$size-1]['p'])+2;
1409-
1408+
if ($size > 0) {
1409+
$pageCellSize=$this->GetStringWidth('p. '.$this->outlines[$size-1]['p'])+2;
1410+
}
1411+
14101412
// Foreach bookmark
14111413
for ($i=0; $i<$size; $i++) {
14121414
// if we need a new page => add a new page

0 commit comments

Comments
 (0)