From 1ab63f8d17af0d29dcca2bcd9bf9781dabcd4d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ludvik?= Date: Fri, 15 Nov 2024 11:04:14 +0100 Subject: [PATCH] [framework]CustomerFileNotFoundException now checks existence of App\Environment so it is working correctly on splited packages (#3599) --- .../Exception/CustomerFileNotFoundException.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Component/CustomerUploadedFile/Exception/CustomerFileNotFoundException.php b/src/Component/CustomerUploadedFile/Exception/CustomerFileNotFoundException.php index 9b40431098..2a9516abb5 100644 --- a/src/Component/CustomerUploadedFile/Exception/CustomerFileNotFoundException.php +++ b/src/Component/CustomerUploadedFile/Exception/CustomerFileNotFoundException.php @@ -17,7 +17,7 @@ class CustomerFileNotFoundException extends CustomerFileException */ public function __construct($message = '', ?Exception $previous = null) { - $isDev = Environment::getEnvironment() === EnvironmentType::DEVELOPMENT; + $isDev = class_exists('App\Environment') && Environment::getEnvironment() === EnvironmentType::DEVELOPMENT; if (!$isDev) { throw new NotFoundHttpException($message, $previous, 0, ['X-Accel-Redirect' => '@storefront']);