it can return NULL if no wifi technology is found, which means the wifi driver has probably crashed.

NetworkManager controls this.