fix the nil pointer panic on closing a disabled network manager
Issue #2768