pr-pull: handle empty string cases

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Jonathan Chang 2020-06-29 18:55:47 +10:00 committed by GitHub
parent bada8dd759
commit 9cab9b7f39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -424,13 +424,13 @@ module GitHub
next if commit.present? && commit != r["commit"]["oid"]
next unless %w[MEMBER OWNER].include? r["authorAssociation"]
email = if r["author"]["email"].empty?
email = if r["author"]["email"].blank?
"#{r["author"]["databaseId"]}+#{r["author"]["login"]}@users.noreply.github.com"
else
r["author"]["email"]
end
name = r["author"]["name"] || r["author"]["login"]
name = r["author"]["name"].presence || r["author"]["login"]
{
"email" => email,