]> cat aescling's git repositories - mastodon.git/commitdiff
Fix error when `scheduled_at` attribute is malformed (#9866)
authorEugen Rochko <eugen@zeonfederated.com>
Sat, 19 Jan 2019 21:01:01 +0000 (22:01 +0100)
committerGitHub <noreply@github.com>
Sat, 19 Jan 2019 21:01:01 +0000 (22:01 +0100)
app/services/post_status_service.rb

index 260765edfd4a3669c76752828d06ffb04a7a75db..cc3453f995a1722cc9cd2dcfea2889b64f0de65c 100644 (file)
@@ -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!