I am receiving an error on the following line of code: Object reference not set to an instance of an object.
if (Session["AutoCompleteCustomersPhone"] != null)
The full block of code:
if (Session["AutoCompleteCustomersPhone"] != null)
earchCustomerPhone = true;
else
{
searchCustomerPhone =
bool.Parse(Session["AutoCompleteCustomersPhone"].ToString());
}
Why, in a test for null, am I receiving this error?

Because sessionn object itself null
i think you are making use of webservice that is the reason why the session is null*
check this aricle if you are using session in webservice : Using Session State in a Web Service