The validator appears to throw an exception when the submitted file is null - since a null / non-existing file is not an infected file, I would suggest wrapping the initial seek(0) with a try/except:
# Check if the file is not empty / exists
try:
file.seek(0)
except:
return
The validator appears to throw an exception when the submitted file is null - since a null / non-existing file is not an infected file, I would suggest wrapping the initial seek(0) with a try/except: