From 6bae3504f8eacd604bc6d543d3eb09f996221dcc Mon Sep 17 00:00:00 2001 From: eilers Date: Mon, 13 Jan 2003 15:49:31 +0000 Subject: Fixing crash when businesscard.vcf is missing.. --- (limited to 'libopie/pim/ocontactaccessbackend_vcard.cpp') diff --git a/libopie/pim/ocontactaccessbackend_vcard.cpp b/libopie/pim/ocontactaccessbackend_vcard.cpp index ca9e410..1dc6b48 100644 --- a/libopie/pim/ocontactaccessbackend_vcard.cpp +++ b/libopie/pim/ocontactaccessbackend_vcard.cpp @@ -17,6 +17,9 @@ * ===================================================================== * History: * $Log$ + * Revision 1.6 2003/01/13 15:49:31 eilers + * Fixing crash when businesscard.vcf is missing.. + * * Revision 1.5 2002/12/07 13:26:22 eilers * Fixing bug in storing anniversary.. * @@ -55,9 +58,15 @@ bool OContactAccessBackend_VCard::load () m_dirty = false; VObject* obj = 0l; - obj = Parse_MIME_FromFileName( QFile::encodeName(m_file).data() ); - if ( !obj ) + + if ( QFile( m_file ).exists() ){ + obj = Parse_MIME_FromFileName( QFile::encodeName(m_file).data() ); + if ( !obj ) + return false; + }else{ + qWarning("File \"%s\" not found !", m_file.latin1() ); return false; + } while ( obj ) { OContact con = parseVObject( obj ); -- cgit v0.9.0.2