Skip to content

readBytes() returns false and code tries accessing it before checking #235

@manuelKruesi

Description

@manuelKruesi

We ran into the following warning:
PHP Warning: Trying to access array offset on value of type bool in
.../vendor-composer/setasign/fpdi/src/PdfParser/CrossReference/FixedReader.php on line 74

I looked into the code and saw the error originates from this call:
$line = $this->reader->readBytes(20)

As stated in the function description in StreamReader.php, the readBytes() returns a string or false.

I dont know why it returned false, but this need to be accounted for in the code to stop the warnings.

Thanks for your amazing work!

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