Skip to content

Commit

Permalink
Merge pull request #123 from rui-castro/master
Browse files Browse the repository at this point in the history
Fixes "NoMethodError (undefined method `text' for nil:NilClass)" issue when reading xlsx file (#122)
  • Loading branch information
Empact committed Apr 28, 2014
2 parents 08c68c3 + d69d198 commit a46611c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/pkg/
/log/
.ruby-version
.project
2 changes: 1 addition & 1 deletion lib/roo/excelx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def read_hyperlinks(sheet=nil)
rels = Hash[rels_doc.xpath("/xmlns:Relationships/xmlns:Relationship").map do |r|
[r.attribute('Id').text, r]
end]
@sheet_doc[n].xpath("/xmlns:worksheet/xmlns:hyperlinks/xmlns:hyperlink").each do |h|
@sheet_doc[n].xpath("/xmlns:worksheet/xmlns:hyperlinks/xmlns:hyperlink[id]").each do |h|
if rel_element = rels[h.attribute('id').text]
row,col = Roo::Base.split_coordinate(h.attributes['ref'].to_s)
@hyperlink[sheet] ||= {}
Expand Down

0 comments on commit a46611c

Please sign in to comment.