Skip to content

Commit bc15cc0

Browse files
committed
Small patch to ignore missing DNS settings from older versions
1 parent d957c15 commit bc15cc0

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

nordnm/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__package__ = "nordnm"
2-
__version__ = "0.5.0"
2+
__version__ = "0.5.1"
33
__license__ = "GNU General Public License v3 or later (GPLv3+)"

nordnm/settings.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,8 @@ def get_ping_attempts(self):
132132
return self.DEFAULT_PING_ATTEMPTS
133133

134134
def get_custom_dns_servers(self) -> list:
135-
custom_dns = self.settings.get('DNS', 'custom-dns-servers')
136-
137-
if custom_dns:
135+
try:
136+
custom_dns = self.settings.get('DNS', 'custom-dns-servers')
138137
return custom_dns.split(' ')
139-
else:
138+
except (configparser.NoSectionError, configparser.NoOptionError): # The setting didn't exist, so ignore it
140139
return []

0 commit comments

Comments
 (0)