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

Remove nil elements from top_nodes array. #3230

Merged
merged 1 commit into from
Jan 12, 2018

Conversation

h-kataria
Copy link
Contributor

Even when section was skipped in x_get_tree_roots method a nil was being added to top_nodes array that was causing undefined method `new' for nil:NilClass
in /app/presenters/tree_node.rb:9. This fix removes any nil elements from array before trying to build RBAC features tree.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1533391

@lgalis please test.

Even when section was skipped in x_get_tree_roots method a nil was being added to top_nodes array that was causing undefined method `new' for nil:NilClass
in /app/presenters/tree_node.rb:9. This fix removes any nil elements from array before trying to build RBAC features tree.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1533391
@miq-bot
Copy link
Member

miq-bot commented Jan 12, 2018

Checked commit h-kataria@1c21e1b with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 1 offense detected

spec/presenters/tree_builder_ops_rbac_features_spec.rb

@h-kataria
Copy link
Contributor Author

@lgalis to recreate this, you can copy config/permissions.tml.yml file in core to permissions.yml and for example remove :sto key from there and restart the server, then try to go to Any roles details screen or Add/Edit a role screen, that should blow up

@mzazrivec mzazrivec added this to the Sprint 77 Ending Jan 15, 2018 milestone Jan 12, 2018
@mzazrivec mzazrivec merged commit d51bc75 into ManageIQ:master Jan 12, 2018
simaishi pushed a commit that referenced this pull request Jan 12, 2018
@simaishi
Copy link
Contributor

Gaprindashvili backport details:

$ git log -1
commit 933fcc457c27fc66b99f9a0eca782d5edf316146
Author: Milan Zázrivec <[email protected]>
Date:   Fri Jan 12 10:38:17 2018 +0100

    Merge pull request #3230 from h-kataria/remove_nil_from_top_nodes
    
    Remove nil elements from top_nodes array.
    (cherry picked from commit d51bc75a78030a417be133de916d1678a2f27a93)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1533391

@h-kataria h-kataria deleted the remove_nil_from_top_nodes branch March 14, 2018 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants