- for (node = attachments; node != NULL; node = g_list_next (node)) {
- TnyMimePart *mime_part = TNY_MIME_PART (node->data);
+ if (tny_list_get_length (attachments)) {
+ g_object_unref (attachments);
+ return FALSE;
+ }
+
+ iter = tny_list_create_iterator (attachments);
+ while (!tny_iterator_is_done (iter)) {
+ TnyMimePart *mime_part = TNY_MIME_PART (tny_iterator_get_current (iter));