We can throw an exception on null using the code below, change myObj to your object.
object myObj = null; ArgumentNullException.ThrowIfNull(myObj);