diff --git a/pyffmpeg/__init__.py b/pyffmpeg/__init__.py index f8cc9fc..bbab5e0 100644 --- a/pyffmpeg/__init__.py +++ b/pyffmpeg/__init__.py @@ -151,7 +151,8 @@ def convert(self, input_file, output_file): except: self.quit() - if 'Output #0' not in stderr: + # This code could be optimized + if stderr and 'Output #0' not in stderr: lines = stderr.splitlines() if len(lines) > 0: self.error = lines[-1]