Added a null pointer to prevent crash if no network present.