Update ReferenceHelper.php (#1873)

* Update ReferenceHelper for Defined Names
This commit is contained in:
Ivan Stanojevic 2021-03-01 12:33:35 +01:00 committed by GitHub
parent 0715b63f11
commit 8721f795fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -608,7 +608,7 @@ class ReferenceHelper
// 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));
}
}