Browse code

[replication] BM-15037 Fix: fallback to attachment when we encounter an unknown disposition type

Thomas Cataldo authored on 09/07/2019 10:52:02
Showing 1 changed files
... ...
@@ -385,7 +385,12 @@ public class BodyStreamProcessor {
385 385
 			SizedBody sized = (SizedBody) sub.getBody();
386 386
 			p.size = sized.size();
387 387
 
388
-			p.dispositionType = DispositionType.valueOfNullSafeIgnoreCase(sub.getDispositionType());
388
+			try {
389
+				p.dispositionType = DispositionType.valueOfNullSafeIgnoreCase(sub.getDispositionType());
390
+			} catch (IllegalArgumentException ie) {
391
+				logger.warn("Invalid disposition type, using {}: {}", DispositionType.ATTACHMENT, ie.getMessage());
392
+				p.dispositionType = DispositionType.ATTACHMENT;
393
+			}
389 394
 
390 395
 			// Apple Mail sends PDFs as inline stuff
391 396
 			// --Apple-Mail=_597C093C-5BA5-4C97-8C3A-FE774541930B