From: Eugen Rochko Date: Sat, 19 Jan 2019 21:01:01 +0000 (+0100) Subject: Fix error when `scheduled_at` attribute is malformed (#9866) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=6ca90157892e2f520da21af05de4e04b4502f5df;p=mastodon.git Fix error when `scheduled_at` attribute is malformed (#9866) --- diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index 260765edf..cc3453f99 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -49,6 +49,8 @@ class PostStatusService < BaseService @visibility = :unlisted if @visibility == :public && @account.silenced @scheduled_at = @options[:scheduled_at]&.to_datetime @scheduled_at = nil if scheduled_in_the_past? + rescue ArgumentError + raise ActiveRecord::RecordInvalid end def process_status!