Closed
Description
This is:
- [x] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
What is the expected behavior?
- Not appear ErrorException
What is the current behavior?
What are the steps to reproduce?
I would like to create PR fix as below:
....
$node->addAttribute('sqref', $item->children('xm', true)->sqref ?? null);
$node->addChild('formula1', $item->formula1->children('xm', true)->f ?? null);
....
I'm worried, will this affect performance?
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
...src\PhpSpreadsheet\Reader\Xlsx.php
....
/**
* Loads Spreadsheet from file.
*/
public function load(string $filename, int $flags = 0): Spreadsheet
{
...
$node->addAttribute('sqref', $item->children('xm', true)->sqref);
$node->addChild('formula1', $item->formula1->children('xm', true)->f);
...
}
https://github.com/PHPOffice/PhpSpreadsheet/blob/master/src/PhpSpreadsheet/Reader/Xlsx.php#L901-L902