Skip to content

Commit ce2418f

Browse files
committed
[gui] reset addrProxy/addrSeparateProxyTor if colon char missing
If addrProxy or addrSeparateProxyTor do not have a colon in the string somewhere in the QSettings storage, then attempting to open the options dialog will cause the entire program to crash.
1 parent dbc4ae0 commit ce2418f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/qt/optionsmodel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void OptionsModel::Init(bool resetSettings)
124124

125125
if (!settings.contains("fUseProxy"))
126126
settings.setValue("fUseProxy", false);
127-
if (!settings.contains("addrProxy"))
127+
if (!settings.contains("addrProxy") || !settings.value("addrProxy").toString().contains(':'))
128128
settings.setValue("addrProxy", "127.0.0.1:9050");
129129
// Only try to set -proxy, if user has enabled fUseProxy
130130
if (settings.value("fUseProxy").toBool() && !gArgs.SoftSetArg("-proxy", settings.value("addrProxy").toString().toStdString()))
@@ -134,7 +134,7 @@ void OptionsModel::Init(bool resetSettings)
134134

135135
if (!settings.contains("fUseSeparateProxyTor"))
136136
settings.setValue("fUseSeparateProxyTor", false);
137-
if (!settings.contains("addrSeparateProxyTor"))
137+
if (!settings.contains("addrSeparateProxyTor") || !settings.value("addrSeparateProxyTor").toString().contains(':'))
138138
settings.setValue("addrSeparateProxyTor", "127.0.0.1:9050");
139139
// Only try to set -onion, if user has enabled fUseSeparateProxyTor
140140
if (settings.value("fUseSeparateProxyTor").toBool() && !gArgs.SoftSetArg("-onion", settings.value("addrSeparateProxyTor").toString().toStdString()))

0 commit comments

Comments
 (0)