A small bug fix so that it no longer blows up if it has no gateways.  Bug #8139.