Skip to content

Commit

Permalink
Update ReferenceHelper.php (#1873)
Browse files Browse the repository at this point in the history
* Update ReferenceHelper for Defined Names
  • Loading branch information
ivanstan committed Mar 1, 2021
1 parent 0715b63 commit 8721f79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PhpSpreadsheet/ReferenceHelper.php
Expand Up @@ -608,7 +608,7 @@ public function insertNewBefore($pBefore, $pNumCols, $pNumRows, Worksheet $pShee
// Update workbook: define names
if (count($pSheet->getParent()->getDefinedNames()) > 0) {
foreach ($pSheet->getParent()->getDefinedNames() as $definedName) {
if ($definedName->getWorksheet()->getHashCode() === $pSheet->getHashCode()) {
if ($definedName->getWorksheet() !== null && $definedName->getWorksheet()->getHashCode() === $pSheet->getHashCode()) {
$definedName->setValue($this->updateCellReference($definedName->getValue(), $pBefore, $pNumCols, $pNumRows));
}
}
Expand Down

0 comments on commit 8721f79

Please sign in to comment.