Fix crash when disconnected
Don't call ping when there is no gateway