Repository: rhettbull/osxphotos
Issue: Traceback if photo.original_filename is None

In my library, several photos seemed to not have an "original_filename".  As such, those photos would case a traceback and stop the export.

Photo library is from macOS 10.13, but has been upgraded over many, many years, so it may have been legacy entries through the years that were causing issues.

```
Exporting 4769 photos to photos...
Traceback (most recent call last):
  File "osxphotos/cli.py", line 19, in <module>
    cli()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/jstrine/Desktop/osxphotos/osxphotos/__main__.py", line 1776, in export
    results = export_photo(
  File "/Users/jstrine/Desktop/osxphotos/osxphotos/__main__.py", line 2437, in export_photo
    export_results = photo.export2(
  File "/Users/jstrine/Desktop/osxphotos/osxphotos/photoinfo/_photoinfo_export.py", line 455, in export2
    fname = pathlib.Path(fname)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/pathlib.py", line 1038, in __new__
    self = cls._from_parts(args, init=False)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/pathlib.py", line 679, in _from_parts
    drv, root, parts = self._parse_args(args)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/pathlib.py", line 663, in _parse_args
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
```

Changed files:
osxphotos/__main__.py

diff --git a/osxphotos/__main__.py b/osxphotos/__main__.py
index 9b811040..429110de 100644
--- a/osxphotos/__main__.py
+++ b/osxphotos/__main__.py
@@ -2579,7 +2579,7 @@ def get_filenames_from_template(photo, filename_template, original_name):
             )
         filenames = [f"{file_}{photo_ext}" for file_ in filenames]
     else:
-        filenames = [photo.original_filename] if original_name else [photo.filename]
+                filenames = [photo.original_filename] if (original_name and (photo.original_filename is not None)) else [photo.filename]
 
     filenames = [sanitize_filename(filename) for filename in filenames]
     return filenames