Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-7303

Avoid NPE if classField doesn't exist in SNBC

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.1
    • Component/s: modules/classification
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      SimpleNaiveBayesClassifier uses MultiFields.getTerms(leafReader, classFieldName). but doesn't check if the resulting Terms is null or not.
      While that is unlikely to happen (it doesn't make much sense to use a classifier without specifying an existing class field), it may happen during testing and therefore better to avoid throwing a NPE.

        Attachments

          Activity

            People

            • Assignee:
              teofili Tommaso Teofili
              Reporter:
              teofili Tommaso Teofili

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment