diff --git a/src/win32_window.c b/src/win32_window.c index c12edcfd..3dceebfc 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -1520,6 +1520,14 @@ void _glfwSetWindowTitleWin32(_GLFWwindow* window, const char* title) void _glfwSetWindowIconWin32(_GLFWwindow* window, int count, const GLFWimage* images) { HICON bigIcon = NULL, smallIcon = NULL; + + if (window == NULL) + { + + _glfwInputError(GLFW_FEATURE_UNAVAILABLE, + "Win32: Requires a valid window handle to set the icon. There is no application icon to set."); + return; + } if (count) { diff --git a/src/wl_window.c b/src/wl_window.c index a227c16f..21cfd816 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1899,7 +1899,7 @@ void _glfwSetWindowIconWayland(_GLFWwindow* window, int count, const GLFWimage* images) { _glfwInputError(GLFW_FEATURE_UNAVAILABLE, - "Wayland: The platform does not support setting the window icon"); + "Wayland: The platform does not support setting the window or application icon"); } void _glfwGetWindowPosWayland(_GLFWwindow* window, int* xpos, int* ypos) diff --git a/src/x11_window.c b/src/x11_window.c index 7da9b965..8ac40435 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -2104,6 +2104,14 @@ void _glfwSetWindowTitleX11(_GLFWwindow* window, const char* title) void _glfwSetWindowIconX11(_GLFWwindow* window, int count, const GLFWimage* images) { + if (window == NULL) + { + + _glfwInputError(GLFW_FEATURE_UNAVAILABLE, + "X11: Requires a valid window handle to set the icon. There is no application icon to set."); + return; + } + if (count) { int longCount = 0;