From 158fd475abbc652613d5eed362dae79f94b17803 Mon Sep 17 00:00:00 2001 From: eilers Date: Fri, 27 Dec 2002 13:03:34 +0000 Subject: Fixing nullpointer crash if "emails" selected --- diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index 1b83308..b68d88c 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp @@ -667,7 +667,10 @@ void ContactEditor::chooserChange( const QString &textChanged, int index, QLineE qDebug("ContactEditor::chooserChange( type=>%s<, textChanged=>%s< index=%i, widgetPos=%i",type.latin1(),textChanged.latin1(), index, widgetPos ); if ( type == "Default Email"){ defaultEmail = textChanged; - if (cmbDefaultEmail) delete cmbDefaultEmail; + if (cmbDefaultEmail){ + delete cmbDefaultEmail; + cmbDefaultEmail = 0l; + } cmbDefaultEmail = new QComboBox(inputWid->parentWidget()); cmbDefaultEmail->setGeometry(inputWid->frameGeometry()); cmbDefaultEmail->show(); @@ -684,7 +687,8 @@ void ContactEditor::chooserChange( const QString &textChanged, int index, QLineE QString de; emails = QStringList::split (",", textChanged ); - populateDefaultEmailCmb(); + if ( cmbDefaultEmail ) + populateDefaultEmailCmb(); } -- cgit v0.9.0.2