diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-07-22 18:54:09 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-22 18:54:09 +0300 |
commit | dc2aab4ee42e4e7ecf14d475b803446fee422cbb (patch) | |
tree | e69eb8ce7fb2857ba24c348b7b738fd962591e4b /indra/newview/llviewercontrol.cpp | |
parent | 75fb5c0d5e54c36327cfdca17e6ccc1682743fe0 (diff) | |
parent | 15877bf396f1b37784a8449540335960190862d0 (diff) |
Merge pull request #2085 from RyeMutt/crash-fixes
Fix various nullptr crashes
Diffstat (limited to 'indra/newview/llviewercontrol.cpp')
-rw-r--r-- | indra/newview/llviewercontrol.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 1d483f1b8a..0e1f4c09c7 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; |