diff --git a/io_mesh_stl/blender_utils.py b/io_mesh_stl/blender_utils.py
index 8589e196800dcbda5f9b4dbc5080f53e52a27985..97621d112bb572be152ae3c6c3cc1d3af336c7b5 100644
--- a/io_mesh_stl/blender_utils.py
+++ b/io_mesh_stl/blender_utils.py
@@ -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