From 01104388549044015ec8caf52f2739a5961f7aa6 Mon Sep 17 00:00:00 2001 From: guqing <38999863+guqing@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:10:02 +0800 Subject: [PATCH] fix: NPE when saving system configuration (#6417) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind bug /area core /milestone 2.18.x #### What this PR does / why we need it: 修复保存系统配置时出现的 NPE 问题 此问题由于 PR #6346 导致 #### Which issue(s) this PR fixes: Fixes #6416 #### Does this PR introduce a user-facing change? ```release-note None ``` --- .../run/halo/app/plugin/DefaultReactiveSettingFetcher.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/src/main/java/run/halo/app/plugin/DefaultReactiveSettingFetcher.java b/application/src/main/java/run/halo/app/plugin/DefaultReactiveSettingFetcher.java index d8cf2ccd49..397e3ff9cf 100644 --- a/application/src/main/java/run/halo/app/plugin/DefaultReactiveSettingFetcher.java +++ b/application/src/main/java/run/halo/app/plugin/DefaultReactiveSettingFetcher.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.databind.node.JsonNodeFactory; import java.util.LinkedHashMap; import java.util.Map; +import java.util.Objects; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeansException; import org.springframework.beans.factory.DisposableBean; @@ -186,7 +187,7 @@ private Map getCachedConfigData(@NonNull Cache cache) { @Override public Controller setupWith(ControllerBuilder builder) { ExtensionMatcher matcher = - extension -> configMapName.equals(extension.getMetadata().getName()); + extension -> Objects.equals(extension.getMetadata().getName(), configMapName); return builder .extension(new ConfigMap()) .syncAllOnStart(true)