mirror of
https://github.com/weechat/weechat.git
synced 2026-06-30 14:56:39 +02:00
core: display an error message if the window number is not found with command /window xxx -window N
This commit is contained in:
+11
-1
@@ -7984,8 +7984,18 @@ COMMAND_CALLBACK(window)
|
||||
{
|
||||
error = NULL;
|
||||
number = strtol (argv[3], &error, 10);
|
||||
if (error && !error[0])
|
||||
if (error && !error[0] && (number >= 1))
|
||||
{
|
||||
ptr_win = gui_window_search_by_number (number);
|
||||
if (!ptr_win)
|
||||
{
|
||||
gui_chat_printf (NULL,
|
||||
_("%sWindow \"%s\" not found"),
|
||||
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
|
||||
argv[3]);
|
||||
return WEECHAT_RC_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* invalid number */
|
||||
|
||||
Reference in New Issue
Block a user