You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Simon Svensson (JIRA)" <ji...@apache.org> on 2019/01/21 07:24:00 UTC

[jira] [Commented] (LUCENENET-605) NullReference Exception is thrown if we create a term with null searchterm

    [ https://issues.apache.org/jira/browse/LUCENENET-605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16747708#comment-16747708 ] 

Simon Svensson commented on LUCENENET-605:
------------------------------------------

You're correct in that ArgumentNullException would be the way to do this in .NET. However, we're currently trying to stay as close as possible as the Java code, and  there are no such checks there. I'll close this issue for now, and we can revisit it later once we're looking into making our api more .net-ish.

> NullReference Exception is thrown if we create a term with null searchterm
> --------------------------------------------------------------------------
>
>                 Key: LUCENENET-605
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-605
>             Project: Lucene.Net
>          Issue Type: Bug
>    Affects Versions: Lucene.Net 4.8.0
>            Reporter: Muhammad Waleed
>            Priority: Major
>
> if you try to create a term by specifying fieldname and null as searchterm, NullReference Exception is thrown, e.g.
> *Term term = new Term("ID", null);*
> However it should throw proper error message like parameter name is null or something likewise. 
> Null Reference exception shows that something is not properly handled underneath,



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)