Skip to content

Trying to access array offset on value of type null (Xls Reader) #2315

@hannanyusop

Description

@hannanyusop

This is:

- [/] 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?

Phpspread can read the xls file

What is the current behavior?

error
"class": "ErrorException",
"message": "Trying to access array offset on value of type null",
"code": 0,
"file": ...//vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls.php:7015",

for now im using below code to keep my system running.

$data = $this->externalNames[$index - 1]['name'] ?? "";

What are the steps to reproduce?

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:

<?php

require __DIR__ . '/vendor/autoload.php';

$spreadsheet = $reader->load($file);
 $writer    = new \PhpOffice\PhpSpreadsheet\Writer\Xls($spreadsheet);
 $writer->save('test.xls');

?>





### Which versions of PhpSpreadsheet and PHP are affected?
[CIMB BizConverter.xls](https://github.com/PHPOffice/PhpSpreadsheet/files/7286322/CIMB.BizConverter.xls)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions