mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
Merge bitcoin/bitcoin#25180: [22.x] qt: Avoid crash on startup if int specified in settings.json
344537cf04
qt: Avoid crash on startup if int specified in settings.json (Ryan Ofsky) Pull request description: Backport of #24498 to 22.x branch This was already backported to the 23.x branch in #24511, but vasild discovered the issue can affect 22.x as well https://github.com/bitcoin/bitcoin/pull/15936#issuecomment-1115992866: > While testing this, 22.x crashes if `settings.json` contains `"prune": 1234` due to #24498 which was fixed in 23.0. So, if this PR is included in 24.x and a user upgrades to 24.x and then downgrades to 22.x his 22.x would crash at startup. It's not very important to backport this to 22.x because I can work around the issue other ways, but I do see 22.x is listed as an active branch https://github.com/bitcoin/bitcoin/branches, so if there is another 22.x release, it would be nice to have this fix and not have a wonky uncaught univalue exception waiting to be hit ACKs for top commit: laanwj: ACK344537cf04
Tree-SHA512: 479f7fb4b4b73ec85f28e97af9b21d54245b8ab4d246e50134b37f1726fe3c57cf388fe4973f8ccf1b9efa7663166d1fbeb631758b39d4490b5eab82d0c83d77
This commit is contained in:
commit
04fdd644b4
1 changed files with 1 additions and 1 deletions
|
@ -588,7 +588,7 @@ bool ArgsManager::IsArgNegated(const std::string& strArg) const
|
|||
std::string ArgsManager::GetArg(const std::string& strArg, const std::string& strDefault) const
|
||||
{
|
||||
const util::SettingsValue value = GetSetting(strArg);
|
||||
return value.isNull() ? strDefault : value.isFalse() ? "0" : value.isTrue() ? "1" : value.get_str();
|
||||
return value.isNull() ? strDefault : value.isFalse() ? "0" : value.isTrue() ? "1" : value.isNum() ? value.getValStr() : value.get_str();
|
||||
}
|
||||
|
||||
int64_t ArgsManager::GetArg(const std::string& strArg, int64_t nDefault) const
|
||||
|
|
Loading…
Add table
Reference in a new issue