Skip to content

Commit 0c4c7af

Browse files
ClearlyClairehiyuki2578
authored andcommitted
Handle blank poll options more gracefully (mastodon#10946)
Pleroma currently allows (erroneously imho) empty poll options, that is, options with an empty (but existing) `name`.
1 parent f800f6b commit 0c4c7af

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/lib/activitypub/activity/create.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def process_poll
234234
@account.polls.new(
235235
multiple: multiple,
236236
expires_at: expires_at,
237-
options: items.map { |item| item['name'].presence || item['content'] },
237+
options: items.map { |item| item['name'].presence || item['content'] }.compact,
238238
cached_tallies: items.map { |item| item.dig('replies', 'totalItems') || 0 }
239239
)
240240
end

0 commit comments

Comments
 (0)