X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/95bfd958bda8955ac81277c78e5627c926154f39..51ba037fa8891066572ff367577770e234089dc0:/wxPython/demo/CalendarCtrl.py diff --git a/wxPython/demo/CalendarCtrl.py b/wxPython/demo/CalendarCtrl.py index f8e5ba78c1..b91e8f8d3e 100644 --- a/wxPython/demo/CalendarCtrl.py +++ b/wxPython/demo/CalendarCtrl.py @@ -27,8 +27,9 @@ class TestPanel(wx.Panel): self.OnChangeMonth() def OnButton(self, evt): - self.cal.Destroy() - self.cal = None + if self.cal is not None: + self.cal.Destroy() + self.cal = None def OnCalSelected(self, evt): self.log.write('OnCalSelected: %s\n' % evt.GetDate())