Selaa lähdekoodia

fix missing validator

boyska 1 vuosi sitten
vanhempi
commit
ab472daf5e
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      techrec/forge.py

+ 1 - 1
techrec/forge.py

@@ -212,7 +212,7 @@ async def create_mp3(
         raise Exception("timeout")  # TODO: make a specific TimeoutError
         raise Exception("timeout")  # TODO: make a specific TimeoutError
     if p.returncode != 0:
     if p.returncode != 0:
         raise OSError("return code was %d" % p.returncode)
         raise OSError("return code was %d" % p.returncode)
-    if not validator(start, end, tmp_file.name):
+    if validator is not None and not validator(start, end, tmp_file.name):
         os.unlink(tmp_file.name)
         os.unlink(tmp_file.name)
         return False
         return False
     os.rename(tmp_file.name, outfile)
     os.rename(tmp_file.name, outfile)