Operating system: Linux Mint
Graphics card: GeForce RTX 2060 Super
Short description of error
Blender crashes when an object with invalid edges is created and then switching to edit mode.
- Expected behavior ***
It should not be possible to add a edges with invalid indices. Does checking this create a performance loss that is too big? At least the edit mode should not crash when such edges are Trying to be accessed. After all the object mode also seems to be handling this fine.
Exact steps for others to reproduce the error
# Start Blender (2.92.0) and run this script import bpy from math import cos, sin # Clean up bpy.ops.object.select_all(action='SELECT') bpy.ops.object.delete() # Create mesh vertices = [[0,0,0],[1,1,0],[2,2,0]] # There is one additional edge in here! edges = [[0,1],[1,2],[2,3]] faces =  mesh = bpy.data.meshes.new('object') obj = bpy.data.objects.new(mesh.name, mesh) mesh.from_pydata(vertices, edges, faces) bpy.context.scene.collection.objects.link(obj) obj.select_set(state=True) bpy.context.view_layer.objects.active = obj # Now press TAB to go to edit mode and make Blender crash # (sometimes need to wait a bit or press several times)