[nautilus-actions] na_factory_object_copy(): do not try to copy null data



commit f4316ca613f037c041037b28e91236a407b1fe5f
Author: Pierre Wieser <pwieser trychlos org>
Date:   Sat Jan 28 18:26:09 2012 +0100

    na_factory_object_copy(): do not try to copy null data

 ChangeLog                    |    3 +++
 src/core/na-factory-object.c |   10 +++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 83c571d..fa72cae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2012-01-28 Pierre Wieser <pwieser trychlos org>
 
+	* src/core/na-factory-object.c (na_factory_object_copy):
+	Only copies non-null provider and provider data items.
+
 	* src/plugin-tracker/na-tracker-dbus.xml:
 	Renamed as src/plugin-tracker/na-tracker-dbus-glib.xml.
 
diff --git a/src/core/na-factory-object.c b/src/core/na-factory-object.c
index 66fdc8d..4e421c7 100644
--- a/src/core/na-factory-object.c
+++ b/src/core/na-factory-object.c
@@ -407,8 +407,12 @@ na_factory_object_copy( NAIFactoryObject *target, const NAIFactoryObject *source
 		}
 	}
 
-	na_object_set_provider( target, provider );
-	na_object_set_provider_data( target, provider_data );
+	if( provider ){
+		na_object_set_provider( target, provider );
+		if( provider_data ){
+			na_object_set_provider_data( target, provider_data );
+		}
+	}
 
 	v_copy( target, source );
 }
@@ -848,7 +852,7 @@ na_factory_object_set_from_void( NAIFactoryObject *object, const gchar *name, co
 	} else {
 		NADataDef *def = na_factory_object_get_data_def( object, name );
 		if( !def ){
-			g_warning( "%s: unknown NADataDef %s", thisfn, name );
+			g_warning( "%s: unknown NADataDef %s for %s", thisfn, name, G_OBJECT_TYPE_NAME( object ));
 
 		} else {
 			boxed = na_data_boxed_new( def );



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]