summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2006-03-14 12:43:02 +0000
committerSebastien Helleu <flashcode@flashtux.org>2006-03-14 12:43:02 +0000
commit7fa3dcbb2efa1e629893593b8d86d18064e906cd (patch)
treeabb50a2479d93d418d57ce55e9ed925ef7ac2a5b /src
parent031fab21b023269024e9ea31641cda061ed456d4 (diff)
downloadweechat-7fa3dcbb2efa1e629893593b8d86d18064e906cd.zip
Fixed plugin get_info bug when no server at all is opened
Diffstat (limited to 'src')
-rw-r--r--src/plugins/plugins-interface.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/plugins/plugins-interface.c b/src/plugins/plugins-interface.c
index 069e1b4f2..282987dd1 100644
--- a/src/plugins/plugins-interface.c
+++ b/src/plugins/plugins-interface.c
@@ -430,12 +430,10 @@ weechat_plugin_get_info (t_weechat_plugin *plugin, char *info, char *server)
/* below are infos that need server to return value */
plugin_find_server_channel (server, NULL, &ptr_server, &ptr_channel);
- if (!ptr_server)
- return NULL;
if (ascii_strcasecmp (info, "nick") == 0)
{
- if (ptr_server->is_connected && ptr_server->nick)
+ if (ptr_server && ptr_server->is_connected && ptr_server->nick)
return strdup (ptr_server->nick);
}
else if (ascii_strcasecmp (info, "channel") == 0)
@@ -445,12 +443,12 @@ weechat_plugin_get_info (t_weechat_plugin *plugin, char *info, char *server)
}
else if (ascii_strcasecmp (info, "server") == 0)
{
- if (ptr_server->is_connected && ptr_server->name)
+ if (ptr_server && ptr_server->is_connected && ptr_server->name)
return strdup (ptr_server->name);
}
else if (ascii_strcasecmp (info, "away") == 0)
{
- if (ptr_server->is_connected && ptr_server->is_away)
+ if (ptr_server && ptr_server->is_connected && ptr_server->is_away)
return strdup ("1");
else
return strdup ("0");