Commit edec9c1
committed
[Unity plugin] Surface a clear error when mesh asset is missing
When an MJCF references a mesh whose asset failed to import, or whose
name collides with another asset of a different type in the Resources
folder, Resources.Load<Mesh>(...) returns null. The Mesh field is then
dereferenced silently later (in BuildMesh / DebugDraw), producing an
opaque NullReferenceException far from the root cause.
Throw a descriptive exception at the load site so users hit the import
abort path with a message that points at the actual problem.
Related to #1354 (typed Resources.Load was already in place; this adds
the missing diagnostic on top).1 parent 5ee8bd7 commit edec9c1
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
40 | 46 | | |
41 | 47 | | |
42 | 48 | | |
| |||
0 commit comments