Fix nullptr dereference when PDF loading fails
Happens e.g. with PDF-looking but invalid data, but also for password locked PDF files.