NULL check

This commit is contained in:
Kovid Goyal 2018-06-07 05:52:55 +05:30
parent 6845dd115e
commit 908823166e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -394,6 +394,7 @@ create_os_window(PyObject UNUSED *self, PyObject *args) {
// The temp window is used to get the DPI.
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
GLFWwindow *temp_window = glfwCreateWindow(640, 480, "temp", NULL, global_state.num_os_windows ? global_state.os_windows[0].handle : NULL);
if (temp_window == NULL) { fatal("Failed to create GLFW temp window!"); }
double dpi_x, dpi_y;
get_window_dpi(temp_window, &dpi_x, &dpi_y);
FONTS_DATA_HANDLE fonts_data = load_fonts_data(global_state.font_sz_in_pts, dpi_x, dpi_y);