Skip to content

Commit d473e6d

Browse files
committed
Merge #11448: [gui] reset addrProxy/addrSeparateProxyTor if colon char missing
ce2418f [gui] reset addrProxy/addrSeparateProxyTor if colon char missing (Cristian Mircea Messel) Pull request description: 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. Fixes #11209 Tree-SHA512: 2d9e6987cf05af3f41033290b61d00920f7fe4a65bea7efd96ed417a8ca7866d248f091e09947cc8aad3a6a4aa8b7777211cfff7f379a62188be50df2c46d4b2
2 parents 17f2ace + ce2418f commit d473e6d

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)