james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [3/3] james-project git commit: JAMES-1945 Don't try to retrieve empty attachment list on Cassandra
Date Mon, 20 Feb 2017 10:41:49 GMT
JAMES-1945 Don't try to retrieve empty attachment list on Cassandra


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/1f6b5494
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/1f6b5494
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/1f6b5494

Branch: refs/heads/master
Commit: 1f6b5494297e0f23ce4e6f174b412cdbe1c26366
Parents: 124749a
Author: Benoit Tellier <btellier@linagora.com>
Authored: Mon Feb 20 15:43:06 2017 +0700
Committer: Benoit Tellier <btellier@linagora.com>
Committed: Mon Feb 20 17:40:00 2017 +0700

----------------------------------------------------------------------
 .../james/mailbox/cassandra/mail/CassandraAttachmentMapper.java   | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/1f6b5494/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraAttachmentMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraAttachmentMapper.java
b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraAttachmentMapper.java
index 3be80dd..c1f9af0 100644
--- a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraAttachmentMapper.java
+++ b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraAttachmentMapper.java
@@ -94,6 +94,9 @@ public class CassandraAttachmentMapper implements AttachmentMapper {
     @Override
     public List<Attachment> getAttachments(Collection<AttachmentId> attachmentIds)
{
         Preconditions.checkArgument(attachmentIds != null);
+        if (attachmentIds.isEmpty()) {
+            return ImmutableList.of();
+        }
         List<String> ids = attachmentIds.stream()
                 .map(AttachmentId::getId)
                 .collect(Guavate.toImmutableList());


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message