Skip to content

Commit

Permalink
Workaround for Row is out of range issue, fixes issue SpartnerNL#437
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickbrouwers committed Jun 4, 2015
1 parent 5f65a59 commit a89a3c3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Maatwebsite/Excel/Parsers/ExcelParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,14 @@ protected function parseRows()
// Get the start row
$startRow = $this->getStartRow();

try {
$rows = $this->worksheet->getRowIterator($startRow);
} catch(PHPExcel_Exception $e) {
$rows = [];
}

// Loop through the rows inside the worksheet
foreach ($this->worksheet->getRowIterator($startRow) as $this->row)
foreach ($rows as $this->row)
{
// Limit the results when needed
if ( $this->hasReachedLimit() )
Expand Down

0 comments on commit a89a3c3

Please sign in to comment.