author | zecke <zecke> | 2002-06-19 17:38:11 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-06-19 17:38:11 (UTC) |
commit | 23ac56db3aa77b298f20b288aadf503fd09a23a9 (patch) (side-by-side diff) | |
tree | fe820ec743bbf829d31ae3ab1436a41a69b1855c | |
parent | dee5f6c5a3bd982913d0b234fb9392ce68d5df63 (diff) | |
download | opie-23ac56db3aa77b298f20b288aadf503fd09a23a9.zip opie-23ac56db3aa77b298f20b288aadf503fd09a23a9.tar.gz opie-23ac56db3aa77b298f20b288aadf503fd09a23a9.tar.bz2 |
Tille ask Diana how she was able to trigger that bug?
I nominate her for the bug finding queen 2002.
Ok I just fixed two possible crashes with the risk of losing
data.
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp index e9e6a0b..3fa1a7c 100644 --- a/core/pim/addressbook/abtable.cpp +++ b/core/pim/addressbook/abtable.cpp @@ -564,2 +564,4 @@ void AbTable::loadFile( const QString &strFile, bool journalFile ) f.close(); + if (ba.isEmpty() ) + return; char *uc = ba.data();//(QChar *)data.unicode(); @@ -799,3 +801,3 @@ void AbTable::journalFreeReplace( const Contact &cnt, int row ) strContact; - AbTableItem *ati; + AbTableItem *ati = 0l; @@ -804,2 +806,3 @@ void AbTable::journalFreeReplace( const Contact &cnt, int row ) ati = static_cast<AbTableItem*>(item(row, 0)); + if ( ati != 0 ) { contactList.remove( ati ); @@ -810,2 +813,8 @@ void AbTable::journalFreeReplace( const Contact &cnt, int row ) ati->setItem( strContact, strName ); + }else{ + int myrows = numRows(); + setNumRows( myrows + 1 ); + insertIntoTable( cnt, myrows ); + // gets deleted when returning + } } |