Problem/Motivation
In \Drupal\pdfpreview\PDFPreviewGenerator::createPDFPreview it is assumed that the source file exists, but there are cases where this isn't the case. That could either be corrupt data, lost files, or e.g. pipelines where not all files are made available.
Steps to reproduce
Proposed resolution
Check for the source file before calling imagemagick.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork pdfpreview-3610075
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
jurgenhaasComment #4
mstrelan commentedIn 2.0.x (which is not ready for real world use) this is already handles and returns NULL. I guess we should match that?
Comment #5
jurgenhaasWell, the doc block declares that this method return boolean, not null. Changing the return type would be a breaking change. Therefore, returning FALSE is probably better here?
Comment #6
mstrelan commentedFair point, I think in 2.0.x it returns the actual file path on success instead of TRUE. I'll have to come back to work on 2.0.x some day.
Comment #8
mstrelan commented