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:
parent
9e1b414bec
commit
902bce5867
|
@ -92,7 +92,8 @@ class PTGDataBase():
|
||||||
|
|
||||||
def add_url(self, track, url):
|
def add_url(self, track, url):
|
||||||
if url == 'none':
|
if url == 'none':
|
||||||
del(self.data['urls'][track])
|
if track in self.data['urls']:
|
||||||
|
del(self.data['urls'][track])
|
||||||
else:
|
else:
|
||||||
self.data['urls'][track] = url
|
self.data['urls'][track] = url
|
||||||
self.save()
|
self.save()
|
||||||
|
|
Loading…
Reference in New Issue