Skip to content

Commit

Permalink
Guard against closing an unopened directory
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelch-r7 committed Dec 5, 2023
1 parent c3b055f commit ddc6212
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ruby_smb/smb2/tree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def list(directory: nil, pattern: '*', type: RubySMB::Fscc::FileInformation::Fil
end
files
ensure
opened_directory.close
opened_directory.close if opened_directory
end

# 'Opens' a directory file on the remote end, using a CreateRequest. This
Expand Down

0 comments on commit ddc6212

Please sign in to comment.