From da970c5c5f0cacbddd57dcffa0cd123f3ca3a10a Mon Sep 17 00:00:00 2001 From: Marcelo Fernandez Date: Thu, 28 Sep 2017 22:07:27 -0300 Subject: [PATCH] Prevent a possible crash when exporting to MeshLibrary --- editor/editor_plugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index 246599be11c..b4460c56190 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -112,8 +112,10 @@ Vector > EditorInterface::make_mesh_previews(const Vector Rect3 rot_aabb = xform.xform(aabb); print_line("rot_aabb: " + rot_aabb); float m = MAX(rot_aabb.size.x, rot_aabb.size.y) * 0.5; - if (m == 0) + if (m == 0) { + textures.push_back(Ref()); continue; + } m = 1.0 / m; m *= 0.5; print_line("scale: " + rtos(m));