Code

Avoid problems when document is being closed.
authorjoncruz <joncruz@users.sourceforge.net>
Fri, 5 Dec 2008 08:58:23 +0000 (08:58 +0000)
committerjoncruz <joncruz@users.sourceforge.net>
Fri, 5 Dec 2008 08:58:23 +0000 (08:58 +0000)
src/profile-manager.cpp

index 19655e0a1b42a54eb7acb5724f40865e20021388..1cd965e390b526d89318918dd7569dfdaec4a049 100644 (file)
@@ -28,10 +28,12 @@ ProfileManager::~ProfileManager()
 void ProfileManager::_resourcesChanged()
 {
     std::vector<SPObject*> 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() );