about summary refs log tree commit diff
path: root/app/services/post_status_service.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-01-19 22:01:01 +0100
committerGitHub <noreply@github.com>2019-01-19 22:01:01 +0100
commit6ca90157892e2f520da21af05de4e04b4502f5df (patch)
tree95c03316726ebda958f624920b7f1d165ae9b5f2 /app/services/post_status_service.rb
parent7c3fddeab4c4ddebca7d5441ac67870aa1cecfe4 (diff)
Fix error when `scheduled_at` attribute is malformed (#9866)
Diffstat (limited to 'app/services/post_status_service.rb')
-rw-r--r--app/services/post_status_service.rb2
1 files changed, 2 insertions, 0 deletions
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!