summaryrefslogtreecommitdiff
path: root/src/managers/AnimationManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-09-06 13:05:37 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-09-06 13:05:37 +0200
commit8b9cc9a8dbebc0dc988a97d95c49cce2993529e1 (patch)
treeffc456ef71bb02f9b3a17a220d6a75a8d6e0b63d /src/managers/AnimationManager.cpp
parent37e2311a3e4124930e1a66de8f8de040f9b7571c (diff)
animationmgr: guard monitor ptr in animationSlide
Diffstat (limited to 'src/managers/AnimationManager.cpp')
-rw-r--r--src/managers/AnimationManager.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp
index 4172a1ff..64cb1c0c 100644
--- a/src/managers/AnimationManager.cpp
+++ b/src/managers/AnimationManager.cpp
@@ -343,7 +343,10 @@ void CAnimationManager::animationSlide(CWindow* pWindow, std::string force, bool
const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID);
- Vector2D posOffset;
+ if (!PMONITOR)
+ return; // unsafe state most likely
+
+ Vector2D posOffset;
if (force != "") {
if (force == "bottom")
@@ -544,7 +547,7 @@ void CAnimationManager::scheduleTick() {
return;
}
- float refreshDelayMs = std::floor(1000.f / PMOSTHZ->refreshRate);
+ float refreshDelayMs = std::floor(1000.f / PMOSTHZ->refreshRate);
const float SINCEPRES = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now() - PMOSTHZ->lastPresentationTimer.chrono()).count() / 1000.f;