Skip to content

Commit 3f99781

Browse files
committed
improved converter lookup
1 parent 368b5fb commit 3f99781

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

logicaldoc-core/src/main/java/com/logicaldoc/core/conversion/FormatConverterManager.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -448,15 +448,13 @@ public FormatConverter getConverter(String inFileName, String outFileName) {
448448
log.warn("No format converter for file {}", inFileName);
449449

450450
// Get the first available and enabled converter
451-
FormatConverter converter = formatConverters != null
452-
? formatConverters.stream().filter(c -> c.isEnabled()).findFirst().orElse(null)
453-
: null;
451+
FormatConverter converter = formatConverters.stream().filter(c -> c.isEnabled()).findFirst().orElse(null);
454452

455453
// Check if a special binding is configured and points to an enabled
456454
// converter
457455
String currentConverter = config.getProperty("converter." + inOutkey);
458456

459-
if (StringUtils.isNotEmpty(currentConverter) && formatConverters != null)
457+
if (StringUtils.isNotEmpty(currentConverter) && formatConverters.size() > 1)
460458
converter = formatConverters.stream()
461459
.filter(conv -> conv.getClass().getName().equals(currentConverter) && conv.isEnabled()).findFirst()
462460
.orElse(null);

0 commit comments

Comments
 (0)