Uncaught Error: Call to a member function getPages() on null
Open
Nobody has claimed this yet.
bug
- Dominant language
- PHP
- Stars
- 2.7k
- Forks
- 579
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
A lot of PDFs (not all...) gives an Error (PHP 7, PHP 7.2 + 7.3)
Uncaught Error: Call to a member function getPages() on null
- Download this test PDF: http://www.orimi.com/pdf-test.pdf
- save to disk
3 run:
$parser = new \Smalot\PdfParser\Parser();
try {
$pdf = $parser->parseFile($file);
} catch(Exception $e) {
}
// echo '<pre>';
// print_r($pdf);
// exit;
// Retrieve all pages from the pdf file.
**$pages = $pdf->getPages();** >>> ERROR
$pageNr = 1;
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the report with the linked pdf-test.pdf and the shown Parser::parseFile() followed by getPages() call. Start by tracing the returned value from parseFile() into getPages(); the issue does not identify a target behavior or acceptance criteria, so the expected handling must be clarified before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100