Repository: khronosgroup/gltf-blender-io
Issue: AttributeError: 'NoneType

Trying to export to gltf, but failing due to error.  I've got no clue why. Attached the blend file.

 - OS: macOS
 - Blender Version 2.92


Python: Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/2.92/scripts/addons/io_scene_gltf2/__init__.py", line 575, in execute
    return gltf2_blender_export.save(context, export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.92/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 46, in save
    json, buffer = __export(export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.92/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 63, in __export
    __gather_gltf(exporter, export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.92/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 72, in __gather_gltf
    active_scene_idx, scenes, animations = gltf2_blender_gather.gather_gltf2(export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.92/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py", line 37, in gather_gltf2
    scenes.append(__gather_scene(blender_scene, export_settings))
  File "/Applications/Blender.app/Contents/Resources/2.92/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/Applications/Blender.app/Contents/Resources/2.92/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py", line 60, in __gather_scene
    blender_scene, None, export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.92/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 46, in gather_node
    node = __gather_node(blender_object, library, blender_scene, dupli_object_parent, export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.92/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/Applications/Blender.app/Contents/Resources/2.92/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 74, in __gather_node
    mesh = __gather_mesh(blender_object, library, export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.92/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 271, in __gather_mesh
    return __gather_mesh_from_nonmesh(blender_object, library, export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.92/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 378, in __gather_mesh_from_nonmesh
    export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.92/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/Applications/Blender.app/Contents/Resources/2.92/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_mesh.py", line 42, in gather_mesh
    name=__gather_name(blender_mesh, library, vertex_groups, modifiers, export_settings),
  File "/Applications/Blender.app/Contents/Resources/2.92/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_mesh.py", line 119, in __gather_name
    return blender_mesh.name
AttributeError: 'NoneType' object has no attribute 'name'

location: <unknown location>:-1

[tg7000 2.blend.zip](https://github.com/KhronosGroup/glTF-Blender-IO/files/6369738/tg7000.2.blend.zip)



Changed files:
addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py, addons/io_scene_gltf2/__init__.py

diff --git a/addons/io_scene_gltf2/__init__.py b/addons/io_scene_gltf2/__init__.py
index 299c298f..49145ef2 100644
--- a/addons/io_scene_gltf2/__init__.py
+++ b/addons/io_scene_gltf2/__init__.py
@@ -15,7 +15,7 @@
 bl_info = {
     'name': 'glTF 2.0 format',
     'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
-    "version": (1, 6, 14),
+    "version": (1, 7, 5),
     'blender': (2, 91, 0),
     'location': 'File > Import-Export',
     'description': 'Import-Export as glTF 2.0',
diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py
index 383af1d1..2f925e80 100644
--- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py
+++ b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py
@@ -356,6 +356,10 @@ def __gather_mesh_from_nonmesh(blender_object, library, export_settings):
             else:
                 blender_mesh_owner = blender_object
                 blender_mesh = blender_mesh_owner.to_mesh()
+                
+            # In some cases (for example curve with single vertice), no blender_mesh is created (without crash)
+            if blender_mesh is None:
+                return None
 
         except Exception:
             return None