Make sure we have an xref before using

KDE bug #335413 had this backtrace
XRef::getNumEntry (this=0x0, offset=-1) at XRef.cc:1300
0x00007f29aec1681e in Lexer::getObj (this=0x1648760, obj=obj@entry=0x1bdf978, cmdA=cmdA@entry=0x7f29aeca66c8 "endstream", objNum=objNum@entry=0) at Lexer.cc:594
0x00007f29aec20dfd in Parser::shift (this=this@entry=0x1bdf950, cmdA=cmdA@entry=0x7f29aeca66c8 "endstream", objNum=objNum@entry=0) at Parser.cc:323
0x00007f29aec20fde in Parser::makeStream (this=this@entry=0x1bdf950, dict=dict@entry=0x7fff2541cad0, fileKey=fileKey@entry=0x0, encAlgorithm=encAlgorithm@entry=cryptRC4, keyLength=keyLength@entry=0, objNum=objNum@entry=0, objGen=objGen@entry=0, recursion=recursion@entry=1, strict=strict@entry=false) at Parser.cc:245
0x00007f29aec216b8 in Parser::getObj (this=this@entry=0x1bdf950, obj=obj@entry=0x7fff2541cad0, simpleOnly=simpleOnly@entry=false, fileKey=fileKey@entry=0x0, encAlgorithm=encAlgorithm@entry=cryptRC4, keyLength=keyLength@entry=0, objNum=objNum@entry=0, objGen=objGen@entry=0, recursion=recursion@entry=0, strict=strict@entry=false) at Parser.cc:131
0x00007f29aec350fc in XRef::readXRef (this=this@entry=0xfe43a0, pos=pos@entry=0xfe4438, followedXRefStm=followedXRefStm@entry=0x7fff2541cb30, xrefStreamObjsNum=xrefStreamObjsNum@entry=0x0) at XRef.cc:551
0x00007f29aec35319 in XRef::XRef (this=0xfe43a0, strA=0x1c54ff0, pos=<optimized out>, mainXRefEntriesOffsetA=0, wasReconstructed=0x7fff2541cbaf, reconstruct=<optimized out>) at XRef.cc:342
0x00007f29aec2534f in PDFDoc::setup (this=this@entry=0x311e1b0, ownerPassword=ownerPassword@entry=0x1165830, userPassword=userPassword@entry=0x447f550) at PDFDoc.cc:262