From kde-commits Sat Jan 05 20:17:12 2008 From: Laurent Montel Date: Sat, 05 Jan 2008 20:17:12 +0000 To: kde-commits Subject: KDE/kdenetwork/kppp Message-Id: <1199564232.784092.28589.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=119956426414308 SVN commit 757753 by mlaurent: Fix crash M +9 -7 pppdata.cpp --- trunk/KDE/kdenetwork/kppp/pppdata.cpp #757752:757753 @@ -409,7 +409,6 @@ return true; } - bool PPPData::deleteModem() { if(cmodem < 0) return false; @@ -441,13 +440,16 @@ // make sure the top modem is cleared setModemByIndex(modemhighcount); map = config->entryMap(cmodemgroup); - it = map.begin(); - KConfigGroup cg2(config, cmodemgroup); - while (!it.key().isNull()) { - cg2.writeEntry(it.key(), ""); - it++; + if( !map.isEmpty()) + { + it = map.begin(); + KConfigGroup cg2(config, cmodemgroup); + while (!it.key().isEmpty()) { + if(!it.key().isEmpty()) + cg2.writeEntry(it.key(), ""); + it++; + } } - modemhighcount--; if(cmodem > modemhighcount) cmodem = modemhighcount;