1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-06 19:41:11 +00:00

Merge pull request #65475 from timothyqiu/bounds-check

Fix crash when executing `VisualShaderNodeParticleMeshEmitter.set_mesh` with headless Godot
This commit is contained in:
Rémi Verschelde
2022-09-07 17:53:19 +02:00

View File

@@ -99,6 +99,7 @@ public:
virtual RS::SurfaceData mesh_get_surface(RID p_mesh, int p_surface) const override {
DummyMesh *m = mesh_owner.get_or_null(p_mesh);
ERR_FAIL_COND_V(!m, RS::SurfaceData());
ERR_FAIL_INDEX_V(p_surface, m->surfaces.size(), RS::SurfaceData());
RS::SurfaceData s = m->surfaces[p_surface];
return s;
}