[utils] Add None check in str_to_int
[youtube-dl] / youtube_dl / utils.py
index 64a9618ca62493f893af16b31b3fbd331bbdc1e7..919603c623ed8cd809745c1314442adabf4567c8 100644 (file)
@@ -1194,6 +1194,8 @@ def format_bytes(bytes):
 
 
 def str_to_int(int_str):
+    if int_str is None:
+        return None
     int_str = re.sub(r'[,\.]', u'', int_str)
     return int(int_str)