mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-09 12:48:32 +09:00
[Fix] (MG_Impl/Getter): Fix crashing when object is nullptr in GetIntegerv.
This commit is contained in:
@@ -52,7 +52,14 @@ namespace MobileGL {
|
||||
|
||||
BindingSlot<BufferObject>& GLContext::GetBufferBindingSlot(BufferTarget target) {
|
||||
if (target == BufferTarget::Index) {
|
||||
return m_vertexArrayState.GetBoundVertexArray()->GetIndexBufferBindingSlot();
|
||||
const auto& vao = m_vertexArrayState.GetBoundVertexArray();
|
||||
if (vao) {
|
||||
return vao->GetIndexBufferBindingSlot();
|
||||
} else {
|
||||
assert(false);
|
||||
static BindingSlot<BufferObject> defaultSlot(BufferTarget::Index);
|
||||
return defaultSlot;
|
||||
}
|
||||
}
|
||||
|
||||
return m_bufferState.GetBindingSlot(target);
|
||||
|
||||
Reference in New Issue
Block a user