# IsNull

> Assert the value is null.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Assertions](/engine/6000.0/script-reference/unityengine/assertions.md)
* **Assembly:** UnityEngine.CoreModule

## IsNull\<T>(T)

Assert the value is null.

```csharp
[Conditional("UNITY_ASSERTIONS")]
public static void IsNull<T>(T value) where T : class
```

### Parameters

**** (T): The Object or type being checked for.

### Examples

```csharp
using UnityEngine;
using UnityEngine.Assertions;

public class AssertionExampleClass : MonoBehaviour
{
    MyClass myClassReference;

    void Update()
    {
        // Make sure the myClassReference reference is never set
        Assert.IsNull(myClassReference);
    }
}

public class MyClass {}
```

## IsNull\<T>(T, string)

Assert the value is null.

```csharp
[Conditional("UNITY_ASSERTIONS")]
public static void IsNull<T>(T value, string message) where T : class
```

### Parameters

**** (T): The Object or type being checked for.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The string used to describe the [Assert](/engine/6000.0/script-reference/unityengine/assertions/assert.md).

### Examples

```csharp
using UnityEngine;
using UnityEngine.Assertions;

public class AssertionExampleClass : MonoBehaviour
{
    MyClass myClassReference;

    void Update()
    {
        // Make sure the myClassReference reference is never set
        Assert.IsNull(myClassReference);
    }
}

public class MyClass {}
```

## IsNull(Object, string)

Assert the value is null.

```csharp
[Conditional("UNITY_ASSERTIONS")]
public static void IsNull(Object value, string message)
```

### Parameters

**** (\[Object]\(/engine/6000.0/script-reference/unityengine/object)): The Object or type being checked for.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The string used to describe the [Assert](/engine/6000.0/script-reference/unityengine/assertions/assert.md).

### Examples

```csharp
using UnityEngine;
using UnityEngine.Assertions;

public class AssertionExampleClass : MonoBehaviour
{
    MyClass myClassReference;

    void Update()
    {
        // Make sure the myClassReference reference is never set
        Assert.IsNull(myClassReference);
    }
}

public class MyClass {}
```
