diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2008-12-13 20:02:55 +0000 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2008-12-13 20:02:55 +0000 | 
| commit | 549545b3c4c1f60eb977e1c16042aac6fe42736c (patch) | |
| tree | 5535de0c17fd243d621563156dfc28cb852037ea /chat.c | |
| parent | 77fc000cf5248e3c82d21ee20c02db25191d0f0f (diff) | |
Checking if acc->prpl->chat_join actually exists before using it. :-/
Diffstat (limited to 'chat.c')
| -rw-r--r-- | chat.c | 6 | 
1 files changed, 5 insertions, 1 deletions
| @@ -29,6 +29,9 @@ struct chat *chat_add( irc_t *irc, account_t *acc, char *handle, char *channel )  {  	struct chat *c, *l;  	set_t *s; + +	if( acc->prpl->chat_join == NULL ) +		return NULL;  	if( !chat_chanok( channel ) )  		return NULL; @@ -177,7 +180,8 @@ int chat_join( irc_t *irc, struct chat *c, const char *password )  	if( nick == NULL )  		nick = irc->nick; -	if( ( gc = c->acc->prpl->chat_join( c->acc->ic, c->handle, nick, password ) ) ) +	if( c->acc->prpl->chat_join && +	    ( gc = c->acc->prpl->chat_join( c->acc->ic, c->handle, nick, password ) ) )  	{  		g_free( gc->channel );  		gc->channel = g_strdup( c->channel ); | 
