Skip to content

Commit 0c299d3

Browse files
committed
Fix NoSuchBeanDefinitionException when there is no site parsers were configured in config file.
Fix #928
1 parent 3a38ffe commit 0c299d3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/ru/mystamps/web/config/EventsConfig.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
*/
1818
package ru.mystamps.web.config;
1919

20+
import java.util.Collections;
2021
import java.util.HashMap;
2122
import java.util.List;
2223
import java.util.Map;
24+
import java.util.Optional;
2325

2426
import javax.annotation.PostConstruct;
2527

@@ -91,12 +93,12 @@ public ApplicationListener<DownloadingFailed> getDownloadingFailedEventListener(
9193

9294
@Bean
9395
public ApplicationListener<DownloadingSucceeded> getDownloadingSucceededEventListener(
94-
List<SiteParser> siteParsers) {
96+
Optional<List<SiteParser>> siteParsers) {
9597

9698
return new DownloadingSucceededEventListener(
9799
LoggerFactory.getLogger(DownloadingSucceededEventListener.class),
98100
servicesConfig.getSeriesImportService(),
99-
siteParsers,
101+
siteParsers.orElse(Collections.emptyList()),
100102
eventPublisher
101103
);
102104
}

0 commit comments

Comments
 (0)