wangyunpeng 3 месяцев назад
Родитель
Сommit
b670cc2404

+ 4 - 2
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/recall/RecallService.java

@@ -368,8 +368,10 @@ public class RecallService implements ApplicationContextAware {
                 ArticleTitleHisCache cache = articleTitleHisCacheMap.get(content.getSourceId());
                 List<ContentHisPublishArticle> hisPublishArticleList =
                         JSONArray.parseArray(cache.getHisPublishArticleList(), ContentHisPublishArticle.class);
-                for (ContentHisPublishArticle article : hisPublishArticleList) {
-                    article.setCorrelation(Optional.ofNullable(accountCorrelationMap.get(article.getGhId())).orElse(0.0));
+                if (CollectionUtils.isNotEmpty(hisPublishArticleList)) {
+                    for (ContentHisPublishArticle article : hisPublishArticleList) {
+                        article.setCorrelation(Optional.ofNullable(accountCorrelationMap.get(article.getGhId())).orElse(0.0));
+                    }
                 }
                 if (StringUtils.hasText(cache.getCategory())) {
                     content.setCategory(JSONArray.parseArray(cache.getCategory(), String.class));