fix: crash when not set layoutname in tagrule

This commit is contained in:
DreamMaoMao 2025-07-26 18:07:29 +08:00
parent af258584ef
commit c4440aa6a5
2 changed files with 2 additions and 0 deletions

View file

@ -2623,6 +2623,7 @@ void reload_config(const Arg *arg) {
!rule_monitor_name) {
for (jk = 0; jk < LENGTH(layouts); jk++) {
if (config.tag_rules_count > 0 &&
config.tag_rules[i - 1].layout_name &&
strcmp(layouts[jk].name,
config.tag_rules[i - 1].layout_name) == 0) {
m->pertag->ltidxs[config.tag_rules[i - 1].id] =

View file

@ -2508,6 +2508,7 @@ void createmon(struct wl_listener *listener, void *data) {
for (i = 1; i <= config.tag_rules_count; i++) {
for (jk = 0; jk < LENGTH(layouts); jk++) {
if (config.tag_rules_count > 0 &&
config.tag_rules[i - 1].layout_name &&
strcmp(layouts[jk].name, config.tag_rules[i - 1].layout_name) ==
0) {
m->pertag->ltidxs[config.tag_rules[i - 1].id] = &layouts[jk];