Browse code

[eas] MDSO-491 Fix: invalid character in 'Subject' breaks email sync

David Phan authored on 21/06/2019 08:47:43
Showing 1 changed files
... ...
@@ -66,12 +66,10 @@ public class StructureMailLoader {
66 66
 	private static final Logger logger = LoggerFactory.getLogger(StructureMailLoader.class);
67 67
 
68 68
 	/**
69
-	 * @param bf
70
-	 *            the body factory used to process the body parts
69
+	 * @param bf    the body factory used to process the body parts
71 70
 	 * @param bs
72 71
 	 * @param mbox
73
-	 * @param store
74
-	 *            must be in selected state
72
+	 * @param store must be in selected state
75 73
 	 */
76 74
 	public StructureMailLoader(BackendSession bs, String mbox, StoreClient store) {
77 75
 		this.store = store;
... ...
@@ -151,6 +149,11 @@ public class StructureMailLoader {
151 149
 		msm.subject = mailHeaders.getSubject();
152 150
 		logger.debug("[{}] mbox '{}', uid '{}': creating structure from summary '{}'", bs.getLoginAtDomain(), mbox,
153 151
 				messageId, msm.subject);
152
+
153
+		if (msm.subject != null) {
154
+			msm.subject = msm.subject.replace("\u0000", "");
155
+		}
156
+
154 157
 		msm.threadTopic = msm.subject;
155 158
 		msm.importance = EmailResponse.Importance.Normal;
156 159