about summary refs log tree commit diff
path: root/app/models/media_attachment.rb
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-07-22 13:38:17 +0200
committerThibaut Girka <thib@sitedethib.com>2020-07-22 13:38:17 +0200
commitb9f351d8455f672137a34ea0ea0b1050fba3464b (patch)
tree4a2dd275ddecf46760ccb8140fac5f6cb21ac766 /app/models/media_attachment.rb
parent801e546ecc1efb4103232d8265229eb455a8dd5b (diff)
parent5d9acc0ce41aa0274fef2dd321a8fad1fb0665ea (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- `app/javascript/mastodon/actions/compose.js`:
  Not a “real” conflict, but change too close to a change we made to
  fix the vanilla WebUI locally pushing authored local-only toots in the
  public TL view.
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