From: Anselm R Garbe <garbeam@gmail.com>
Date: Wed, 11 Jun 2008 18:42:24 +0000 (+0100)
Subject: crash fix
X-Git-Url: https://git.xinqibao.xyz/dwm.git/commitdiff_plain/8f052596b2c79e74c0e47b93595f13a754b3e2ef?ds=sidebyside

crash fix
---

diff --git a/dwm.c b/dwm.c
index ec37588..f5aa010 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1478,7 +1478,7 @@ togglefloating(const Arg *arg) {
 
 void
 togglelayout(const Arg *arg) {
-	if(arg->v)
+	if(arg && arg->v)
 		lt = (Layout *)arg->v;
 	else if(++lt == &layouts[LENGTH(layouts)])
 		lt = &layouts[0];