diff --git a/modules/gltf/structures/gltf_buffer_view.cpp b/modules/gltf/structures/gltf_buffer_view.cpp index d40ed69915a7..8588de075236 100644 --- a/modules/gltf/structures/gltf_buffer_view.cpp +++ b/modules/gltf/structures/gltf_buffer_view.cpp @@ -94,6 +94,7 @@ void GLTFBufferView::set_indices(bool p_indices) { } Vector GLTFBufferView::load_buffer_view_data(const Ref p_state) const { + ERR_FAIL_COND_V(p_state.is_null(), Vector()); ERR_FAIL_COND_V_MSG(byte_stride > 0, Vector(), "Buffer views with byte stride are not yet supported by this method."); const TypedArray> &buffers = p_state->get_buffers(); ERR_FAIL_INDEX_V(buffer, buffers.size(), Vector());