diff --git a/src/classes/document.php b/src/classes/document.php
index <HASH>..<HASH> 100644
--- a/src/classes/document.php
+++ b/src/classes/document.php
@@ -523,6 +523,12 @@ abstract class phpillowDocument
             );
         }
 
+        // Restore the __attachments array if it has been removed before
+        if ( !isset( $this->storage->_attachments ) ) 
+        {
+            $this->storage->_attachments = array();
+        }
+
         return $this->storage->_id = $response->id;
     }
# Fixed: _attachments property is now only removed while the request is sent,
# if it has been empty.


git-svn-id: svn://arbitracker.org/phpillow/trunk@<I> c<I>fd1-f2a0-<I>e-a8e5-<I>dc<I>