Do not free a NULL pointer! This fixes a CRITICAL: > g_object_unref: assertion 'G_IS_OBJECT (object)' failed