1
0
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:
Sébastien Helleu
2025-11-12 07:05:56 +01:00
parent b9f1145d03
commit 6981f9f204
+11 -1
View File
@@ -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 */