fix: 修复异常 Shape 未校验问题
This commit is contained in:
@@ -47,6 +47,9 @@ impl ShapeForge {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn compute_depth(shape_id: ShapeId, shapes: &[Option<Arc<Shape>>]) -> u32 {
|
fn compute_depth(shape_id: ShapeId, shapes: &[Option<Arc<Shape>>]) -> u32 {
|
||||||
|
if shape_id == 0 {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
let mut count = 0u32;
|
let mut count = 0u32;
|
||||||
let mut cursor = Some(shape_id);
|
let mut cursor = Some(shape_id);
|
||||||
while let Some(id) = cursor {
|
while let Some(id) = cursor {
|
||||||
|
|||||||
Reference in New Issue
Block a user