diff options
author | Poommetee Ketson <poommetee@protonmail.com> | 2017-10-02 23:47:23 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-02 23:47:23 +0700 |
commit | 4b57e078ae396e12c7bb4c77f11893d49f543c32 (patch) | |
tree | b86507e2e1dc945edcfaac4fa87c75bfa7669581 | |
parent | 980e78749b738ee224468730593fef401d415740 (diff) | |
parent | da970c5c5f0cacbddd57dcffa0cd123f3ca3a10a (diff) |
Merge pull request #11674 from marcelofg55/master
Prevent a possible crash when exporting to MeshLibrary
-rw-r--r-- | editor/editor_plugin.cpp | 4 |
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)); |