diff --git a/direct/src/wxwidgets/WxPandaWindow.py b/direct/src/wxwidgets/WxPandaWindow.py index 585a75558b..446cf4b3b9 100644 --- a/direct/src/wxwidgets/WxPandaWindow.py +++ b/direct/src/wxwidgets/WxPandaWindow.py @@ -62,10 +62,11 @@ class EmbeddedPandaWindow(wx.Window): self.win = None def onSize(self, event): - wp = WindowProperties() - wp.setOrigin(0, 0) - wp.setSize(*self.GetClientSize()) - self.win.requestProperties(wp) + if self.win: + wp = WindowProperties() + wp.setOrigin(0, 0) + wp.setSize(*self.GetClientSize()) + self.win.requestProperties(wp) event.Skip() if not hasattr(wxgl, 'GLCanvas'):