Jelajahi Sumber

LibGUI: Verify m_window_id is not-zero in set_maximized

Window::set_maximized requires non-zero window id to be a valid call,
i.e. calling Window::show beforehand. A verify statement before the
server call can help developers by hinting correct usage.
Aziz Berkay Yesilyurt 4 tahun lalu
induk
melakukan
6f594b36f5
1 mengubah file dengan 1 tambahan dan 0 penghapusan
  1. 1 0
      Userland/Libraries/LibGUI/Window.cpp

+ 1 - 0
Userland/Libraries/LibGUI/Window.cpp

@@ -948,6 +948,7 @@ bool Window::is_maximized() const
 
 
 void Window::set_maximized(bool maximized)
 void Window::set_maximized(bool maximized)
 {
 {
+    VERIFY(m_window_id != 0);
     WindowServerConnection::the().async_set_maximized(m_window_id, maximized);
     WindowServerConnection::the().async_set_maximized(m_window_id, maximized);
 }
 }