@@ -535,21 +535,25 @@ class MeshStorage : public RendererMeshStorage {
535535
536536 _FORCE_INLINE_ RS::MultimeshTransformFormat multimesh_get_transform_format (RID p_multimesh) const {
537537 MultiMesh *multimesh = multimesh_owner.get_or_null (p_multimesh);
538+ ERR_FAIL_NULL_V (multimesh, RS::MULTIMESH_TRANSFORM_3D);
538539 return multimesh->xform_format ;
539540 }
540541
541542 _FORCE_INLINE_ bool multimesh_uses_colors (RID p_multimesh) const {
542543 MultiMesh *multimesh = multimesh_owner.get_or_null (p_multimesh);
544+ ERR_FAIL_NULL_V (multimesh, false );
543545 return multimesh->uses_colors ;
544546 }
545547
546548 _FORCE_INLINE_ bool multimesh_uses_custom_data (RID p_multimesh) const {
547549 MultiMesh *multimesh = multimesh_owner.get_or_null (p_multimesh);
550+ ERR_FAIL_NULL_V (multimesh, false );
548551 return multimesh->uses_custom_data ;
549552 }
550553
551554 _FORCE_INLINE_ uint32_t multimesh_get_instances_to_draw (RID p_multimesh) const {
552555 MultiMesh *multimesh = multimesh_owner.get_or_null (p_multimesh);
556+ ERR_FAIL_NULL_V (multimesh, 0 );
553557 if (multimesh->visible_instances >= 0 ) {
554558 return multimesh->visible_instances ;
555559 }
@@ -558,21 +562,25 @@ class MeshStorage : public RendererMeshStorage {
558562
559563 _FORCE_INLINE_ GLuint multimesh_get_gl_buffer (RID p_multimesh) const {
560564 MultiMesh *multimesh = multimesh_owner.get_or_null (p_multimesh);
565+ ERR_FAIL_NULL_V (multimesh, 0 );
561566 return multimesh->buffer ;
562567 }
563568
564569 _FORCE_INLINE_ uint32_t multimesh_get_stride (RID p_multimesh) const {
565570 MultiMesh *multimesh = multimesh_owner.get_or_null (p_multimesh);
571+ ERR_FAIL_NULL_V (multimesh, 0 );
566572 return multimesh->stride_cache ;
567573 }
568574
569575 _FORCE_INLINE_ uint32_t multimesh_get_color_offset (RID p_multimesh) const {
570576 MultiMesh *multimesh = multimesh_owner.get_or_null (p_multimesh);
577+ ERR_FAIL_NULL_V (multimesh, 0 );
571578 return multimesh->color_offset_cache ;
572579 }
573580
574581 _FORCE_INLINE_ uint32_t multimesh_get_custom_data_offset (RID p_multimesh) const {
575582 MultiMesh *multimesh = multimesh_owner.get_or_null (p_multimesh);
583+ ERR_FAIL_NULL_V (multimesh, 0 );
576584 return multimesh->custom_data_offset_cache ;
577585 }
578586
0 commit comments