dashboard.accords-library.com/patches/payload+2.18.3.patch

14 lines
915 B
Diff

diff --git a/node_modules/payload/dist/uploads/imageResizer.js b/node_modules/payload/dist/uploads/imageResizer.js
index 0122c02..995cb08 100644
--- a/node_modules/payload/dist/uploads/imageResizer.js
+++ b/node_modules/payload/dist/uploads/imageResizer.js
@@ -162,7 +162,7 @@ function _interop_require_default(obj) {
async function resizeAndTransformImageSizes({ config, dimensions, file, mimeType, req, savedFilename, staticPath, uploadEdits }) {
const { focalPoint: focalPointEnabled = true, imageSizes } = config.upload;
// Focal point adjustments
- const incomingFocalPoint = uploadEdits.focalPoint ? {
+ const incomingFocalPoint = uploadEdits?.focalPoint ? {
x: (0, _isNumber.isNumber)(uploadEdits.focalPoint.x) ? Math.round(uploadEdits.focalPoint.x) : 50,
y: (0, _isNumber.isNumber)(uploadEdits.focalPoint.y) ? Math.round(uploadEdits.focalPoint.y) : 50
} : undefined;