summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorMarcelo Fernandez <marcelofg55@gmail.com>2017-09-28 22:07:27 -0300
committerMarcelo Fernandez <marcelofg55@gmail.com>2017-09-28 22:08:13 -0300
commitda970c5c5f0cacbddd57dcffa0cd123f3ca3a10a (patch)
tree076f96731e927b59cea96accb3d1923456ba8235 /editor
parent4f39ce32b9195405f934445b20059e86632b47f9 (diff)
Prevent a possible crash when exporting to MeshLibrary
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_plugin.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index 246599be11..b4460c5619 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -112,8 +112,10 @@ Vector<Ref<Texture> > EditorInterface::make_mesh_previews(const Vector<Ref<Mesh>
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<Texture>());
continue;
+ }
m = 1.0 / m;
m *= 0.5;
print_line("scale: " + rtos(m));