From 90f2b089ebb2da133d27b612e21ae2f5fb4115d5 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Sun, 2 Mar 2025 23:51:56 -0600 Subject: [PATCH] fix nullref when switching vsync mode with turbo mode --- src/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs b/src/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs index f50ec852e..4620821cb 100644 --- a/src/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs +++ b/src/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs @@ -1065,7 +1065,14 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed /// private void UpdateIndexBufferState() { - IndexBufferState indexBuffer = _state.State.IndexBufferState; + IndexBufferState? indexBufferNullable = _state?.State.IndexBufferState; + + if (!indexBufferNullable.HasValue) + { + return; + } + + IndexBufferState indexBuffer = indexBufferNullable.Value; if (_drawState.IndexCount == 0) {