Skip to content

Commit

Permalink
hotfix: do not crash if no appdata is available
Browse files Browse the repository at this point in the history
  • Loading branch information
bugfinder committed Apr 16, 2020
1 parent f1f604c commit a8f7d92
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/appdata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ def self.get_distribution(dist = 'factory', flavour = 'oss')
index_url = "https://download.opensuse.org/tumbleweed/repo/#{flavour}/repodata/repomd.xml"
repomd = Nokogiri::XML(open(index_url))
repomd.remove_namespaces!
href = repomd.xpath('/repomd/data[@type="appdata"]/location').attr('href').text
href = if repomd.xpath('/repomd/data[@type="appdata"]/location').attr('href')
repomd.xpath('/repomd/data[@type="appdata"]/location').attr('href').text
else
'none'
end
"https://download.opensuse.org/tumbleweed/repo/#{flavour}/#{href}"
else
"https://download.opensuse.org/distribution/#{dist}/repo/#{flavour}/suse/setup/descr/appdata.xml.gz"
Expand Down

0 comments on commit a8f7d92

Please sign in to comment.