From 5d46ee2289768da82dfd5aa9ac9b57353395c916 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sat, 4 May 2024 20:59:09 +0200 Subject: [PATCH] fix: do not segfault for NULL client monitor --- dwl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dwl.c b/dwl.c index ac077e3..0af70f0 100644 --- a/dwl.c +++ b/dwl.c @@ -453,8 +453,10 @@ applyrules(Client *c) } } } - c->geom.x = (mon->w.width - c->geom.width) / 2 + mon->m.x; - c->geom.y = (mon->w.height - c->geom.height) / 2 + mon->m.y; + if (mon) { + c->geom.x = (mon->w.width - c->geom.width) / 2 + mon->m.x; + c->geom.y = (mon->w.height - c->geom.height) / 2 + mon->m.y; + } setmon(c, mon, newtags); } -- 2.48.1