From b15a3614dc7466e983e1394a12a16874a812e672 Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 27 Jun 2024 17:25:27 +0200 Subject: [PATCH] Stub `Vips::Error` when not using libvips (#30857) --- config/initializers/vips.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/initializers/vips.rb b/config/initializers/vips.rb index 25a17b2a17..8d5d5cdc91 100644 --- a/config/initializers/vips.rb +++ b/config/initializers/vips.rb @@ -25,3 +25,11 @@ if Rails.configuration.x.use_vips Vips.block_untrusted(true) end + +# In some places of the code, we rescue this exception, but we don't always +# load libvips, so it may be an undefined constant: +unless defined?(Vips) + module Vips + class Error < StandardError; end + end +end