diff --git a/scripts/pdf_unlock.py b/scripts/pdf_unlock.py index 472a51c..707716d 100644 --- a/scripts/pdf_unlock.py +++ b/scripts/pdf_unlock.py @@ -116,7 +116,11 @@ def pdf_unlock(pdf_file, overwrite=False): return # Skip file if it is not encrypted - if not isencrypted(pdf_file): + try: + if not isencrypted(pdf_file): + return + # SKip file if pdf info cannot be read + except AttributeError: return # Get name of Ghostscript executable