Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TypeError: can't dup NilClass from EntrySet#dup #264

Merged
merged 1 commit into from
Jan 4, 2016
Merged

Fix TypeError: can't dup NilClass from EntrySet#dup #264

merged 1 commit into from
Jan 4, 2016

Conversation

shhavel
Copy link
Contributor

@shhavel shhavel commented Dec 19, 2015

Zip::File.open('test/data/test.xls') # => TypeError: can't dup NilClass
# from rubyzip/lib/zip/entry_set.rb:48:in `dup'

EntrySet contains 5 nil values:

{ "" => nil, "" => nil, "" => nil, "" => nil, "" => nil }

it causes exception in EntrySet#dup

Maybe Zip::Error should be raised instead.

$ unzip test/data/test.xls
Archive:  test/data/test.xls
warning [test/data/test.xls]:  144078 extra bytes at beginning or within zipfile
  (attempting to process anyway)
  inflating: [Content_Types].xml     
  inflating: _rels/.rels             
  inflating: theme/theme/themeManager.xml  
  inflating: theme/theme/theme1.xml  
  inflating: theme/theme/_rels/themeManager.xml.rels 

@simonoff
Copy link
Member

simonoff commented Jan 4, 2016

Саша дякую!

simonoff added a commit that referenced this pull request Jan 4, 2016
Fix TypeError: can't dup NilClass from EntrySet#dup
@simonoff simonoff merged commit 4b41915 into rubyzip:master Jan 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants