Fix potential NULL pointer access

This commit is contained in:
Raphael Coeffic
2021-06-14 06:31:28 +02:00
parent 7c88dfd762
commit b53982eebe
+2 -3
View File
@@ -53,10 +53,9 @@ Window::~Window()
void Window::attach(Window * newParent) void Window::attach(Window * newParent)
{ {
if (parent) if (parent) detach();
detach();
parent = newParent; parent = newParent;
newParent->addChild(this); if (newParent) newParent->addChild(this);
} }
void Window::detach() void Window::detach()