about summary refs log tree commit diff
path: root/app/models/media_attachment.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-07-22 15:39:36 +0200
committerGitHub <noreply@github.com>2020-07-22 15:39:36 +0200
commit4024952b58bacb94d2cb43fafddf0e97bea4c55c (patch)
treeb1c1e5cdb84606879d65ecceebe4cf665332379b /app/models/media_attachment.rb
parent801e546ecc1efb4103232d8265229eb455a8dd5b (diff)
parentf8e315cd74d05a6878bbd018b20462daa0b5e660 (diff)
Merge pull request #1385 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/models/media_attachment.rb')
-rw-r--r--app/models/media_attachment.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb
index 0441fc699..cfdd95b22 100644
--- a/app/models/media_attachment.rb
+++ b/app/models/media_attachment.rb
@@ -336,6 +336,7 @@ class MediaAttachment < ApplicationRecord
 
     return unless movie.valid?
 
+    raise Mastodon::StreamValidationError, 'Video has no video stream' if movie.width.nil? || movie.frame_rate.nil?
     raise Mastodon::DimensionsValidationError, "#{movie.width}x#{movie.height} videos are not supported" if movie.width * movie.height > MAX_VIDEO_MATRIX_LIMIT
     raise Mastodon::DimensionsValidationError, "#{movie.frame_rate.to_i}fps videos are not supported" if movie.frame_rate > MAX_VIDEO_FRAME_RATE
   end