mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-23 12:35:41 +02:00
module/i3: don't try to strdup() a NULL pointer
This commit is contained in:
parent
fe709bd82b
commit
cd28099ad8
1 changed files with 3 additions and 1 deletions
|
@ -368,7 +368,9 @@ handle_window_event(int type, const struct json_object *json, void *_mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
free(ws->window.title);
|
free(ws->window.title);
|
||||||
ws->window.title = strdup(json_object_get_string(name));
|
|
||||||
|
const char *title = json_object_get_string(name);
|
||||||
|
ws->window.title = title != NULL ? strdup(title) : NULL;
|
||||||
ws->window.id = json_object_get_int(id);
|
ws->window.id = json_object_get_int(id);
|
||||||
|
|
||||||
/* If PID has changed, update application name from /proc/<pid>/comm */
|
/* If PID has changed, update application name from /proc/<pid>/comm */
|
||||||
|
|
Loading…
Add table
Reference in a new issue