From dcba3fed4f2abf001ced72b573f6e50f6b37e1e6 Mon Sep 17 00:00:00 2001 From: zecke Date: Mon, 17 Jun 2002 14:54:47 +0000 Subject: Fix a possible crash when opening an empty file --- (limited to 'libopie') diff --git a/libopie/tododb.cpp b/libopie/tododb.cpp index 1e40c40..17163a0 100644 --- a/libopie/tododb.cpp +++ b/libopie/tododb.cpp @@ -68,6 +68,8 @@ public: qWarning("ToDoDB::load tagName(): %s", root->tagName().latin1() ); //if( root->tagName() == QString::fromLatin1("Tasks" ) ){// Start XMLElement *element = root->firstChild(); + if (element == 0 ) + return m_todos; element = element->firstChild(); while( element ){ if( element->tagName() != QString::fromLatin1("Task") ){ -- cgit v0.9.0.2