Embeds: Catch TypeErrors when casting width and height to integers

pull/242/merge
Karl Hobley 2014-05-13 17:18:33 +01:00
rodzic 1ecc215759
commit 5474f7ef39
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -155,12 +155,12 @@ def get_embed(url, max_width=None, finder=None):
# Make sure width and height are valid integers before inserting into database
try:
embed_dict['width'] = int(embed_dict['width'])
except ValueError:
except (TypeError, ValueError):
embed_dict['width'] = None
try:
embed_dict['height'] = int(embed_dict['height'])
except ValueError:
except (TypeError, ValueError):
embed_dict['height'] = None
# Create database record