]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_wizrd.cpp
Unconditional assert means failure.
[wxWidgets.git] / src / xrc / xh_wizrd.cpp
index 9016e921d87976d80cc2529467022e9dd87f1edd..fd49ef89f75b0ad4f9e723c97d74ea905c5dc2ff 100644 (file)
@@ -55,8 +55,7 @@ wxObject *wxWizardXmlHandler::DoCreateResource()
     }
     else
     {
-        wxWizardPage *page = NULL;
-        wxUnusedVar(page);
+        wxWizardPage *page;
 
         if (m_class == wxT("wxWizardPageSimple"))
         {
@@ -69,13 +68,14 @@ wxObject *wxWizardXmlHandler::DoCreateResource()
         }
         else /*if (m_class == wxT("wxWizardPage"))*/
         {
-            wxWizardPage *p = NULL;
-            if (m_instance)
-                p = wxStaticCast(m_instance, wxWizardPage);
-            else
+            if ( !m_instance )
+            {
                 wxLogError(wxT("wxWizardPage is abstract class, must be subclassed"));
-            p->Create(m_wizard, GetBitmap());
-            page = p;
+                return NULL;
+            }
+
+            page = wxStaticCast(m_instance, wxWizardPage);
+            page->Create(m_wizard, GetBitmap());
         }
 
         page->SetName(GetName());