fix: fixed auto connection combobox when autoStartGroupId is null

This commit is contained in:
Qv2ray-dev 2020-07-10 08:31:26 +08:00
parent e25fbfaecf
commit 002bc4b7d1
No known key found for this signature in database
GPG Key ID: E7FAEFAFCD031D4B
2 changed files with 8 additions and 2 deletions

View File

@ -1 +1 @@
5756
5757

View File

@ -213,6 +213,11 @@ PreferencesWindow::PreferencesWindow(QWidget *parent) : QvDialog(parent), Curren
//
SET_AUTOSTART_UI_ENABLED(CurrentConfig.autoStartBehavior == AUTO_CONNECTION_FIXED);
//
if (CurrentConfig.autoStartId.isEmpty())
{
CurrentConfig.autoStartId.groupId = DefaultGroupId;
}
//
auto autoStartConnId = CurrentConfig.autoStartId.connectionId;
auto autoStartGroupId = CurrentConfig.autoStartId.groupId;
//
@ -698,7 +703,8 @@ void PreferencesWindow::on_setSysProxyCB_stateChanged(int arg1)
void PreferencesWindow::on_autoStartSubsCombo_currentIndexChanged(const QString &arg1)
{
LOADINGCHECK if (arg1.isEmpty())
LOADINGCHECK
if (arg1.isEmpty())
{
CurrentConfig.autoStartId.clear();
autoStartConnCombo->clear();