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 multiple creatures committed Nov 19, 2019
1 parent f406e72 commit 0fd8575
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 @@ -334,7 +334,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 0fd8575

Please sign in to comment.