capability: handle NULL passed to capability_get().
This commit is contained in:
parent
ce4fa4477b
commit
d7e4ed772f
1 changed files with 2 additions and 0 deletions
|
@ -46,6 +46,8 @@ capability_get(struct CapabilityIndex *idx, const char *cap)
|
||||||
struct CapabilityEntry *entry;
|
struct CapabilityEntry *entry;
|
||||||
|
|
||||||
s_assert(idx != NULL);
|
s_assert(idx != NULL);
|
||||||
|
if (cap == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
entry = irc_dictionary_retrieve(idx->cap_dict, cap);
|
entry = irc_dictionary_retrieve(idx->cap_dict, cap);
|
||||||
if (entry != NULL && !(entry->flags & CAP_ORPHANED))
|
if (entry != NULL && !(entry->flags & CAP_ORPHANED))
|
||||||
|
|
Loading…
Reference in a new issue