Skip to content

Commit

Permalink
Fix undefined method '[]' in kiwi import
Browse files Browse the repository at this point in the history
Use dig instead of accessing the values with the key.
This way it can not happen that source is nil and throws
an undefined method error.

Fix #5738.
  • Loading branch information
ChrisBr committed Sep 6, 2018
1 parent 873a6af commit 2893636
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/app/models/kiwi/image/xml_parser.rb
Expand Up @@ -36,7 +36,7 @@ def repositories_from_xml

def use_project_repositories?
repositories_from_xml.any? do |repository|
repository['source']['path'] == 'obsrepositories:/'
repository.dig('source', 'path') == 'obsrepositories:/'
end
end

Expand Down

0 comments on commit 2893636

Please sign in to comment.