check that the headers object exists before getting the headers.