summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorRye Mutt <rye@alchemyviewer.org>2024-07-22 10:59:35 -0400
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-08-09 22:55:08 +0300
commit04fdc4f2c098dc8a5a87ffa6b85652cc8c8dad1b (patch)
tree777ad05ec56eb04e12566d4cac55bba486129820 /indra
parent9e379a5578f56dca05b303707e150c2de04c0c43 (diff)
Fix nullptr crash in handleVSyncChanged
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llviewercontrol.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index cd6e780aa8..862bb3dfa9 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -263,12 +263,15 @@ static bool handleAnisotropicChanged(const LLSD& newvalue)
static bool handleVSyncChanged(const LLSD& newvalue)
{
LLPerfStats::tunables.vsyncEnabled = newvalue.asBoolean();
- gViewerWindow->getWindow()->toggleVSync(newvalue.asBoolean());
-
- if (newvalue.asBoolean())
+ if (gViewerWindow && gViewerWindow->getWindow())
{
- U32 current_target = gSavedSettings.getU32("TargetFPS");
- gSavedSettings.setU32("TargetFPS", std::min((U32)gViewerWindow->getWindow()->getRefreshRate(), current_target));
+ gViewerWindow->getWindow()->toggleVSync(newvalue.asBoolean());
+
+ if (newvalue.asBoolean())
+ {
+ U32 current_target = gSavedSettings.getU32("TargetFPS");
+ gSavedSettings.setU32("TargetFPS", std::min((U32)gViewerWindow->getWindow()->getRefreshRate(), current_target));
+ }
}
return true;