Skip to content

Commit

Permalink
fix(render): add null checks to prevent crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
nnyyxxxx committed Feb 5, 2025
1 parent 84c9bae commit 30ecc6b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/render/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,9 @@ void CHyprRenderer::renderMonitor(PHLMONITOR pMonitor) {

pMonitor->tearingState.activelyTearing = shouldTear;

if ((*PDIRECTSCANOUT == 1 || (*PDIRECTSCANOUT == 2 && pMonitor->activeWorkspace->getFullscreenWindow()->getContentType() == CONTENT_TYPE_GAME)) && !shouldTear) {
if ((*PDIRECTSCANOUT == 1 ||
(*PDIRECTSCANOUT == 2 && pMonitor->activeWorkspace->getFullscreenWindow() && pMonitor->activeWorkspace->getFullscreenWindow()->getContentType() == CONTENT_TYPE_GAME)) &&
!shouldTear) {
if (pMonitor->attemptDirectScanout()) {
return;
} else if (!pMonitor->lastScanout.expired()) {
Expand Down

0 comments on commit 30ecc6b

Please sign in to comment.