From 5b3610dab2f75e518fefa8a9ad3076b6366b054a Mon Sep 17 00:00:00 2001
From: Robin Dunn <robin@alldunn.com>
Date: Fri, 10 May 2002 18:41:57 +0000
Subject: [PATCH] Fixed a crash when GetMonthControl returns NULL

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15488 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 src/generic/calctrl.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/generic/calctrl.cpp b/src/generic/calctrl.cpp
index 810fa252f5..dd81cba7fe 100644
--- a/src/generic/calctrl.cpp
+++ b/src/generic/calctrl.cpp
@@ -768,7 +768,7 @@ void wxCalendarCtrl::DoGetSize(int *width, int *height) const
     if ( !(GetWindowStyle() & wxCAL_SEQUENTIAL_MONTH_SELECTION) )
     {
         // our real height is bigger
-        if ( height )
+        if ( height && GetMonthControl())
         {
             *height += GetMonthControl()->GetSize().y + VERT_MARGIN;
         }
-- 
2.47.2