Skip to content

Commit

Permalink
Only try splitting the license text if there's actually a license giv…
Browse files Browse the repository at this point in the history
…en. This avoids a crash.
  • Loading branch information
jordansissel committed Nov 29, 2022
1 parent dcbe042 commit db06af3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/fpm/package/python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ def load_package_info(setup_py)
self.description = metadata["description"]
# Sometimes the license field is multiple lines; do best-effort and just
# use the first line.
self.license = metadata["license"].split(/[\r\n]+/).first
if metadata["license"]
self.license = metadata["license"].split(/[\r\n]+/).first
end
self.version = metadata["version"]
self.url = metadata["url"]

Expand Down

0 comments on commit db06af3

Please sign in to comment.