title: 'NoneType' object has no attribute 'to_dict'
body: <p>I'am quite new to python and I am developing a passport scanner with a RaspberryPi and the passport eye module. In the end it prints outs the outcome of the scanned image. However, I also want to print an outcome if the scanner isn't able tot detect a MRZ code.</p>
  <p>I tried some things but couldn't figure it out, here is a example in short:</p>
  <pre><code>mrz = read_mrz(&quot;test.jpg&quot;)
  mrz_data = mrz.to_dict()
  
  if mrz.to_dict == None:
   print(&quot;Invalid document&quot;)
  
  else:
   print(mrz_data[&quot;names&quot;])
  </code></pre>
  <blockquote>
  <p>Error in 
  mrz_data = mrz.to_dict() AttributeError: 'NoneType' object has no attribute 'to_dict'</p>
  </blockquote>
  <p>EDIT: Is there a way to print when the error is 'NoneType' object has no attribute 'to_dict'</p>