Check if video mode is valid and rename to match with other methods (#5235)

This commit is contained in:
Maicon Santana 2025-10-05 21:26:25 +01:00 committed by GitHub
parent b9e7cb64c5
commit de50402dd5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -959,8 +959,11 @@ int GetMonitorRefreshRate(int monitor)
if ((monitor >= 0) && (monitor < monitorCount))
{
const GLFWvidmode *vidmode = glfwGetVideoMode(monitors[monitor]);
refresh = vidmode->refreshRate;
const GLFWvidmode *mode = glfwGetVideoMode(monitors[monitor]);
if (mode) refresh = mode->refreshRate;
else TRACELOG(LOG_WARNING, "GLFW: Failed to find video mode for selected monitor");
}
else TRACELOG(LOG_WARNING, "GLFW: Failed to find selected monitor");