-
Notifications
You must be signed in to change notification settings - Fork 130
Open
Description
Ran into a case where a client's SFTP server had files and folders with no attributes set for mtime, createtime etc. This causes a hard crash TypeError (can't convert nil into an exact number)
Tried to create a PR to resolve this but received a 403 when trying to push.
name.rb
longname << Time.at(attributes.mtime || 0).strftime("%b %e %H:%M ")
test_name.rb
@directory_no_mtime = Net::SFTP::Protocol::V04::Name.new("test", Net::SFTP::Protocol::V04::Attributes.new(:type => 2, :mtime => nil, :owner => "jamis", :group => "users", :size => 1024, :permissions => 0755))
...
def test_longname_should_fallback_to_time_at_0_if_mtime_is_nil
assert_equal "drwxr-xr-x jamis users 1024 Jan 1 00:00 test",
@directory_no_mtime.longname
end
Metadata
Metadata
Assignees
Labels
No labels