Skip to content

Commit

Permalink
Handle blank poll options more gracefully (mastodon#10946)
Browse files Browse the repository at this point in the history
Pleroma currently allows (erroneously imho) empty poll options, that is,
options with an empty (but existing) `name`.
  • Loading branch information
ClearlyClaire authored and Gargron committed Jun 3, 2019
1 parent 3e7e8d7 commit 240b7b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/lib/activitypub/activity/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def process_poll
@account.polls.new(
multiple: multiple,
expires_at: expires_at,
options: items.map { |item| item['name'].presence || item['content'] },
options: items.map { |item| item['name'].presence || item['content'] }.compact,
cached_tallies: items.map { |item| item.dig('replies', 'totalItems') || 0 }
)
end
Expand Down

0 comments on commit 240b7b1

Please sign in to comment.