Skip to content

Commit

Permalink
Remove unnecessary null check
Browse files Browse the repository at this point in the history
`isUsingSources(attached, sources)` always return `false` if `attached` is `null`
  • Loading branch information
quaff committed May 31, 2024
1 parent fa131fa commit 7cefbf8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public static void attach(Environment environment) {
Assert.isInstanceOf(ConfigurableEnvironment.class, environment);
MutablePropertySources sources = ((ConfigurableEnvironment) environment).getPropertySources();
PropertySource<?> attached = getAttached(sources);
if (attached == null || !isUsingSources(attached, sources)) {
if (!isUsingSources(attached, sources)) {
attached = new ConfigurationPropertySourcesPropertySource(ATTACHED_PROPERTY_SOURCE_NAME,
new SpringConfigurationPropertySources(sources));
}
Expand Down

0 comments on commit 7cefbf8

Please sign in to comment.