Uploaded image for project: 'Lucene.Net'
  1. Lucene.Net
  2. LUCENENET-615

PerFieldAnalyzerWrapper.GetTokenStream throws NullReferenceException when first arg is null. It does not default.

    XMLWordPrintableJSON

Details

    Description

      var english = new EnglishAnalyzer(Lucene.Net.Util.LuceneVersion.LUCENE_48);

      var whitespace = new WhitespaceAnalyzer(Lucene.Net.Util.LuceneVersion.LUCENE_48);

      var pf = new PerFieldAnalyzerWrapper(english, new Dictionary<string, Analyzer>() { { "foo", whitespace }});

      var test1 = english.GetTokenStream(null, "test"); // Does not throw

      var test2 = pf.GetTokenStream("", "test"); // works

      var test3 = pf.GetTokenStream(null, "test"); // Throws NullReferenceException

       

      I don't think I'm doing anything wrong, but the last line crashes with the abovementioned exception.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              emimull Emil Müller
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: