I would like to prevent further processing on an object if it is null.
In the following code I check if the object is null by either:
if (!data.Equal
Whenever you are creating objects of class you have to check the whether the object is null or not using the below code.
Example: object1 is object of class
void myFunction(object1) { if(object1!=null) { object1.value1 //If we miss the null check then here we get the Null Reference exception } }