Fix crash when genrating meshes thumbnails.