STL: fix T72145 crash exporting object without data

This commit is contained in:
Mikhail Rachinskiy 2019-12-04 08:46:23 +04:00
parent 5f1ad50707
commit 2f425cc128
Notes: blender-bot 2023-02-14 19:04:24 +01:00
Referenced by commit 14420434: Revert "STL: fix T72145 crash exporting object without data"
Referenced by commit 14420434, Revert "STL: fix T72145 crash exporting object without data"
Referenced by issue #72145, Import-Export STL Format Hard Crash
1 changed files with 3 additions and 1 deletions

View File

@ -80,7 +80,8 @@ def faces_from_mesh(ob, global_matrix, use_mesh_modifiers=False):
import bpy
# get the editmode data
ob.update_from_editmode()
if ob.mode == "EDIT":
ob.update_from_editmode()
# get the modifiers
if use_mesh_modifiers:
@ -94,6 +95,7 @@ def faces_from_mesh(ob, global_matrix, use_mesh_modifiers=False):
mesh = mesh_owner.to_mesh()
except RuntimeError:
return
if mesh is None:
return