Fix bot crash when 'none' URL provided

If a "none" URL is passed for a track but that track did not
have a customized URL in the first place, the bot would crash.
This fixes it by not doing anything in that case.

Change-Id: I9ab45ad7d07700efe5af208eb4c5b1285fd9deeb
This commit is contained in:
Thierry Carrez 2020-10-30 14:35:25 +01:00
parent 9e1b414bec
commit 902bce5867
1 changed files with 2 additions and 1 deletions

View File

@ -92,7 +92,8 @@ class PTGDataBase():
def add_url(self, track, url):
if url == 'none':
del(self.data['urls'][track])
if track in self.data['urls']:
del(self.data['urls'][track])
else:
self.data['urls'][track] = url
self.save()