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

Prevent warnings due to Hash#[] call with nil items #136

Merged
merged 1 commit into from
May 12, 2014

Conversation

sunaot
Copy link
Contributor

@sunaot sunaot commented May 12, 2014

When filters.keys.all? { |key| plugin[key.to_s] == filters[key] } returns false in PluginManager#list_installed, Hash#[] would be called with some nil items like the following code Hash[ [1,2], nil, [3,4] ], and this triggers warnings on Ruby 2.x. This patch prevents these warnings.

tmp.rb:1: warning: wrong element type nil at 1 (expected array)
tmp.rb:1: warning: ignoring wrong elements is deprecated, remove them explicitly
tmp.rb:1: warning: this causes ArgumentError in the next release

arangamani added a commit that referenced this pull request May 12, 2014
Prevent warnings due to Hash#[] call with nil items
@arangamani arangamani merged commit 6e7a836 into arangamani:master May 12, 2014
@arangamani
Copy link
Owner

Thanks for the patch @sunaot!

@sunaot sunaot deleted the stop-warning branch May 13, 2014 10:36
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.

2 participants