-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp index 00d62ee..18113c2 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp @@ -587,33 +587,33 @@ bool OPimContactAccessBackend_XML::load( const QString filename, bool isJournal dict.insert( "Birthday", new int(Qtopia::Birthday) ); dict.insert( "Anniversary", new int(Qtopia::Anniversary) ); dict.insert( "Nickname", new int(Qtopia::Nickname) ); dict.insert( "Notes", new int(Qtopia::Notes) ); dict.insert( "action", new int(JOURNALACTION) ); dict.insert( "actionrow", new int(JOURNALROW) ); //owarn << "OPimContactDefaultBackEnd::loading " << filename << "" << oendl; XMLElement *root = XMLElement::load( filename ); if(root != 0l ){ // start parsing /* Parse all XML-Elements and put the data into the * Contact-Class */ XMLElement *element = root->firstChild(); //owarn << "OPimContactAccess::load tagName(): " << root->tagName() << "" << oendl; - element = element->firstChild(); + element = element ? element->firstChild() : 0; /* Search Tag "Contacts" which is the parent of all Contacts */ while( element && !isJournal ){ if( element->tagName() != QString::fromLatin1("Contacts") ){ //owarn << "OPimContactDefBack::Searching for Tag \"Contacts\"! Found: " // << element->tagName() << oendl; element = element->nextChild(); } else { element = element->firstChild(); break; } } /* Parse all Contacts and ignore unknown tags */ while( element ){ if( element->tagName() != QString::fromLatin1("Contact") ){ //owarn << "OPimContactDefBack::Searching for Tag \"Contact\"! Found: " |