added check for null document in DocumentAnnotator.