From c00045335cefa6e2b657934424dcb25a55da9e08 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Wed, 28 Jan 2004 19:00:37 +0000 Subject: Don't crash when reading the RDF file fails. 2004-01-28 Christian Persch * src/bookmarks/ephy-bookmarks-import.c: (ephy_bookmarks_import_rdf): Don't crash when reading the RDF file fails. --- ChangeLog | 7 +++++++ src/bookmarks/ephy-bookmarks-import.c | 10 +++++++++- src/bookmarks/ephy-topic-action.c | 4 ++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0096b3b48..0ff5a51de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-01-28 Christian Persch + + * src/bookmarks/ephy-bookmarks-import.c: + (ephy_bookmarks_import_rdf): + + Don't crash when reading the RDF file fails. + 2004-01-28 Christian Persch * src/bookmarks/ephy-bookmarks-export.c: diff --git a/src/bookmarks/ephy-bookmarks-import.c b/src/bookmarks/ephy-bookmarks-import.c index d38c1f5d0..0903b37aa 100644 --- a/src/bookmarks/ephy-bookmarks-import.c +++ b/src/bookmarks/ephy-bookmarks-import.c @@ -804,7 +804,15 @@ ephy_bookmarks_import_rdf (EphyBookmarks *bookmarks, return FALSE; doc = xmlParseFile (filename); - g_assert (doc != NULL); + if (doc == NULL) + { + /* FIXME: maybe put up a warning dialogue here, because this + * is a severe dataloss? + */ + g_warning ("Failed to re-import the bookmarks. All bookmarks lost!\n"); + return FALSE; + } + root = xmlDocGetRootElement (doc); child = root->children; diff --git a/src/bookmarks/ephy-topic-action.c b/src/bookmarks/ephy-topic-action.c index 1861418ff..572fede52 100644 --- a/src/bookmarks/ephy-topic-action.c +++ b/src/bookmarks/ephy-topic-action.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003 Marco Pesenti Gritti + * Copyright (C) 2003, 2004 Marco Pesenti Gritti * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ */ #ifdef HAVE_CONFIG_H -#include +#include "config.h" #endif #include -- cgit v1.2.3