Search Unity

Checking UnityEvent is null before Invoking

Discussion in 'Scripting' started by Deleted User, Nov 27, 2015.

  1. Deleted User

    Deleted User

    Guest

    I'm getting some null reference exceptions when invoking UnityEvents with no listeners. Is this normal behaviour?
     
  2. BenZed

    BenZed

    Joined:
    May 29, 2014
    Posts:
    524
    No. If you're getting a null reference exception, it's because the unityevent itself is null.