Skip to content

Commit 66664c7

Browse files
prthakrejzheaux
authored andcommitted
Close Stream When Null Results
Closes gh-1169 Signed-off-by: Prashant Thakre <[email protected]>
1 parent ada147f commit 66664c7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/src/main/java/org/springframework/ldap/core/LdapTemplate.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,6 +1588,7 @@ <T> Stream<T> searchForStream(LdapQuery query, Function<SearchResult, T> mapper)
15881588
return ctx.search(base, encodedFilter, searchControls);
15891589
});
15901590
if (results == null) {
1591+
closeContextAndNamingEnumeration(ctx, null);
15911592
return Stream.empty();
15921593
}
15931594
return StreamSupport

0 commit comments

Comments
 (0)