Fix #30230, Crash after importing collada file
[blender.git] / source / blender / collada / MeshImporter.cpp
index 1e5783f8ad0e83e064c5dd98ce75923ca76b8487..92852120bca31abaf9bfcf021c0e48ea6fd822fa 100644 (file)
@@ -746,6 +746,9 @@ MTex *MeshImporter::assign_textures_to_uvlayer(COLLADAFW::TextureCoordinateBindi
        
        const CustomData *data = &me->fdata;
        int layer_index = CustomData_get_layer_index(data, CD_MTFACE);
+
+       if(layer_index == -1) return NULL;
+
        CustomDataLayer *cdl = &data->layers[layer_index+setindex];
        
        /* set uvname to bind_vertex_input semantic */