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

Avoid NPE if classField doesn't exist in SNBC

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 6.1
    • modules/classification
    • None
    • 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

            teofili Tommaso Teofili
            teofili Tommaso Teofili
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: