Nullpointer when linked destination is not visible

If a a linked destination is outside the pdf page, PdfDestination returned by createDestination is null, creating a null pointer exception.