Skip to content

Commit 7a3db14

Browse files
authored
Merge pull request #16979 from iterate-ch/bugfix/GH-16135
Lazy initialize DiskSharePool.
2 parents af3c8af + 0aec62b commit 7a3db14

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

smb/src/main/java/ch/cyberduck/core/smb/SMBSession.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,13 @@ public void login(final LoginCallback prompt, final CancelCallback cancel) throw
287287
public DiskShareWrapper openShare(final Path file) throws BackgroundException {
288288
try {
289289
final String shareName = containerService.getContainer(file).getName();
290-
final GenericObjectPool<DiskShareWrapper> pool;
290+
GenericObjectPool<DiskShareWrapper> pool;
291291
lock.lock();
292292
try {
293-
pool = pools.getOrDefault(shareName, new DiskSharePool(shareName));
293+
pool = pools.get(shareName);
294+
if(null == pool) {
295+
pool = new DiskSharePool(shareName);
296+
}
294297
if(pool.getNumIdle() == 0) {
295298
log.warn("No idle share for {} with {} active", shareName, pool.getNumActive());
296299
}

0 commit comments

Comments
 (0)