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

Table: Protect against nil in rows/column loop #92

Merged
merged 1 commit into from
Jun 2, 2017

Conversation

olleolleolle
Copy link
Contributor

This PR avoids a NoMethodError, which plagued me on 1.7.3:

Output of a failed usage:

/Users/olle/.gem/ruby/2.4.0/gems/terminal-table-1.7.3/lib/terminal-table/table.rb:32:in `block in align_column': undefined method `alignment?' for nil:NilClass (NoMethodError)
	from /Users/olle/.gem/ruby/2.4.0/gems/terminal-table-1.7.3/lib/terminal-table/table.rb:30:in `each'
	from /Users/olle/.gem/ruby/2.4.0/gems/terminal-table-1.7.3/lib/terminal-table/table.rb:30:in `each_with_index'
	from /Users/olle/.gem/ruby/2.4.0/gems/terminal-table-1.7.3/lib/terminal-table/table.rb:30:in `align_column'
	from /Users/olle/.gem/ruby/2.4.0/gems/fukuzatsu-2.3.1/lib/fukuzatsu/formatters/text.rb:36:in `export'
	from /Users/olle/.gem/ruby/2.4.0/gems/fukuzatsu-2.3.1/lib/fukuzatsu/parser.rb:24:in `block in report'
	from /Users/olle/.gem/ruby/2.4.0/gems/fukuzatsu-2.3.1/lib/fukuzatsu/parser.rb:23:in `each'
	from /Users/olle/.gem/ruby/2.4.0/gems/fukuzatsu-2.3.1/lib/fukuzatsu/parser.rb:23:in `report'
	from /Users/olle/.gem/ruby/2.4.0/gems/fukuzatsu-2.3.1/lib/fukuzatsu/cli.rb:22:in `check'
	from /Users/olle/.gem/ruby/2.4.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
	from /Users/olle/.gem/ruby/2.4.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
	from /Users/olle/.gem/ruby/2.4.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
	from /Users/olle/.gem/ruby/2.4.0/gems/thor-0.19.4/lib/thor/base.rb:444:in `start'
	from /Users/olle/.gem/ruby/2.4.0/gems/fukuzatsu-2.3.1/bin/fuku:3:in `<top (required)>'

Skipping on when the cell is nil would avoid this.

@nateberkopec nateberkopec merged commit bded36c into tj:master Jun 2, 2017
@olleolleolle olleolleolle deleted the patch-1 branch June 2, 2017 21:27
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