Skip to content

Commit 0dfded0

Browse files
authored
Check decorations exist before setting the dirty flag for repaint (#42)
Avoids a potential crash when calling a method on a nullptr.
1 parent 795bd8d commit 0dfded0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/qadwaitadecorations.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,9 @@ QRect QAdwaitaDecorations::windowContentGeometry() const
695695
void QAdwaitaDecorations::forceRepaint()
696696
{
697697
// Set dirty flag
698-
waylandWindow()->decoration()->update();
698+
if (waylandWindow()->decoration()) {
699+
waylandWindow()->decoration()->update();
700+
}
699701
// Force re-paint
700702
// NOTE: not sure it's correct, but it's the only way to make it work
701703
if (waylandWindow()->backingStore()) {

0 commit comments

Comments
 (0)