mirror of
https://github.com/yshui/picom.git
synced 2024-10-27 05:24:17 -04:00
atom: fix segfault when atom is not in the cache
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
592c2212f9
commit
0551d63b5f
1 changed files with 5 additions and 1 deletions
|
@ -75,7 +75,11 @@ xcb_atom_t get_atom(struct atom *a, const char *key, size_t keylen, xcb_connecti
|
|||
|
||||
xcb_atom_t get_atom_cached(struct atom *a, const char *key, size_t keylen) {
|
||||
auto atoms = container_of(a, struct atom_impl, base);
|
||||
return cache_entry(cache_get(&atoms->c, key, keylen), struct atom_entry, entry)->atom;
|
||||
auto entry = cache_get(&atoms->c, key, keylen);
|
||||
if (!entry) {
|
||||
return XCB_NONE;
|
||||
}
|
||||
return cache_entry(entry, struct atom_entry, entry)->atom;
|
||||
}
|
||||
|
||||
const char *get_atom_name(struct atom *a, xcb_atom_t atom, xcb_connection_t *c) {
|
||||
|
|
Loading…
Reference in a new issue