Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
channel tags: more strict checking for tag create
  • Loading branch information
perexg committed Oct 15, 2015
1 parent 65ce2f0 commit 1943929
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/channels.c
Expand Up @@ -929,6 +929,9 @@ channel_tag_map(channel_tag_t *ct, channel_t *ch, void *origin)
{
idnode_list_mapping_t *ilm;

if (ct == NULL || ch == NULL)
return NULL;

ilm = idnode_list_link(&ct->ct_id, &ct->ct_ctms,
&ch->ch_id, &ch->ch_ctms,
origin);
Expand Down Expand Up @@ -1232,7 +1235,7 @@ channel_tag_find_by_name(const char *name, int create)
{
channel_tag_t *ct;

if (name == NULL)
if (name == NULL || *name == '\0')
return NULL;

TAILQ_FOREACH(ct, &channel_tags, ct_link)
Expand Down

0 comments on commit 1943929

Please sign in to comment.