Commit 56e476cd authored by Simeon Bird's avatar Simeon Bird
Browse files

Fix crash if asked to index invalid pdf document. Fix is

as suggested in the poppler-qt4 example.

BUG: 310912
parent 1225d953
......@@ -53,6 +53,12 @@ SimpleResourceGraph PopplerExtractor::extract(const QUrl& resUri, const QUrl& fi
SimpleResource fileRes( resUri );
Poppler::Document* pdfDoc = Poppler::Document::load( fileUrl.toLocalFile(), 0, 0 );
if ( !pdfDoc || pdfDoc->isLocked() ){
delete pdfDoc;
return graph;
}
QString title = pdfDoc->info(QLatin1String("Title"));
if( !title.isEmpty() ) {
fileRes.addProperty( NIE::title(), title );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment