From 177089acbcef5892c724ef4cae93c1e6e501302d Mon Sep 17 00:00:00 2001 From: joncruz Date: Fri, 5 Dec 2008 08:58:23 +0000 Subject: [PATCH] Avoid problems when document is being closed. --- src/profile-manager.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/profile-manager.cpp b/src/profile-manager.cpp index 19655e0a1..1cd965e39 100644 --- a/src/profile-manager.cpp +++ b/src/profile-manager.cpp @@ -28,10 +28,12 @@ ProfileManager::~ProfileManager() void ProfileManager::_resourcesChanged() { std::vector newList; - const GSList *current = sp_document_get_resource_list( _doc, "iccprofile" ); - while ( current ) { - newList.push_back(SP_OBJECT(current->data)); - current = g_slist_next(current); + if (_doc) { + const GSList *current = sp_document_get_resource_list( _doc, "iccprofile" ); + while ( current ) { + newList.push_back(SP_OBJECT(current->data)); + current = g_slist_next(current); + } } sort( newList.begin(), newList.end() ); -- 2.30.2