Author: ludovic
Date: 2008-01-17 14:36:07 +0100 (Thu, 17 Jan 2008)
New Revision: 6919

Modified:
   
xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/api/Document.java
Log:
XWIKI-2017 NullPointer in addAttachments in Document

Modified: 
xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/api/Document.java
===================================================================
--- 
xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/api/Document.java
   2008-01-17 12:40:56 UTC (rev 6918)
+++ 
xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/api/Document.java
   2008-01-17 13:36:07 UTC (rev 6919)
@@ -1680,7 +1680,8 @@
             if ((data != null) && (data.length > 0)) {
                 XWikiAttachment attachment = addAttachment(filename, data);
                 getDoc().saveAttachmentContent(attachment, getXWikiContext());
-                getDoc().getAttachmentList().add(attachment);
+                // commenting because this was already done by addAttachment
+                // getDoc().getAttachmentList().add(attachment);
                 attachments.add(attachment);
                 nb++;
             }
@@ -1713,7 +1714,8 @@
         if (attachment == null) {
             attachment = new XWikiAttachment();
             // TODO: Review this code and understand why it's needed.
-            getDoc().getOriginalDocument().getAttachmentList().add(attachment);
+            // commenting it because it creates a null pointer
+            getDoc().getAttachmentList().add(attachment);
         }
 
         attachment.setContent(data);

_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications

Reply via email to