# Nil != null?

**URL:** <https://www.ruby-forum.com/t/nil-null/166951>\
**Category:** IronRuby\
**Created:** [May 1, 2009, 10:19am UTC](https://www.ruby-forum.com/t/nil-null/166951 "2009-05-01T10:19:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![barby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c57346/32.png) [@barby](https://www.ruby-forum.com/u/barby)\
**Post date:** [May 1, 2009, 10:19am UTC](https://www.ruby-forum.com/t/nil-null/166951/1 "2009-05-01T10:19:33Z")

</div>

Hi  
I had specs that used to work but now apparently they don’t anymore.  
I’d expect that a nil from ruby maps to null in C# but this doesn’t seem  
to  
be the case.

I’m using the following code

```
    public static bool IsNotNull(this object value)
    {
        return value != null;
    }

    public static bool IsNull(this object value)
    {
        return value == null;
    }

```

> > > ObjectExtensions.is\_null(nil)  
> > > :0: can’t convert NilClass into Object (TypeError)

I’d expect it to return true 😉

* * *

Author of IronRuby in Action ([http://manning.com/carrero](http://manning.com/carrero))
