Avoid NullReferenceException when request times out