forked from external/yambar
module/battery: don't crash if 'sysname' in udev event is NULL
This commit is contained in:
parent
86e6aea152
commit
ae871853ca
1 changed files with 1 additions and 1 deletions
|
@ -348,7 +348,7 @@ run(struct module *mod)
|
|||
struct udev_device *dev = udev_monitor_receive_device(mon);
|
||||
const char *sysname = udev_device_get_sysname(dev);
|
||||
|
||||
bool is_us = strcmp(sysname, m->battery) == 0;
|
||||
bool is_us = sysname != NULL && strcmp(sysname, m->battery) == 0;
|
||||
udev_device_unref(dev);
|
||||
|
||||
if (!is_us)
|
||||
|
|
Loading…
Add table
Reference in a new issue