Handle missing settingsversion.

Otherwise I get this with python 3.8.7 when starting BM: TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType' (assuming changes in https://github.com/Bitmessage/PyBitmessage/pull/1746)
This commit is contained in:
Ilja 2021-03-23 17:24:43 +02:00 committed by GitHub
parent 6f9b66ddff
commit ba731a9282
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,6 +128,8 @@ def loadConfig():
def updateConfig(): def updateConfig():
"""Save the config""" """Save the config"""
config = BMConfigParser() config = BMConfigParser()
if not config.has_option('bitmessagesettings', 'settingsversion'):
config.set('bitmessagesettings', 'settingsversion', 1)
settingsversion = config.getint('bitmessagesettings', 'settingsversion') settingsversion = config.getint('bitmessagesettings', 'settingsversion')
if settingsversion == 1: if settingsversion == 1:
config.set('bitmessagesettings', 'socksproxytype', 'none') config.set('bitmessagesettings', 'socksproxytype', 'none')