Skip to content

Commit 769296c

Browse files
committed
Image cropper provides no dimensions in error for single-size configs
When only one size is configured, `smallestSize` is undefined, showing the user an error with blank dimensions.
1 parent 8d354c8 commit 769296c

File tree

2 files changed

+2
-2
lines changed
  • ts/WoltLabSuite/Core/Component/Image
  • wcfsetup/install/files/js/WoltLabSuite/Core/Component/Image

2 files changed

+2
-2
lines changed

ts/WoltLabSuite/Core/Component/Image/Cropper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ class ExactImageCropper extends ImageCropper {
357357

358358
if (sizes.length === 0) {
359359
const smallestSize =
360-
this.configuration.sizes.length > 1 ? this.configuration.sizes[this.configuration.sizes.length - 1] : undefined;
360+
this.configuration.sizes.length > 0 ? this.configuration.sizes[this.configuration.sizes.length - 1] : undefined;
361361
throw new Error(
362362
getPhrase("wcf.upload.error.image.tooSmall", {
363363
width: smallestSize?.width,

wcfsetup/install/files/js/WoltLabSuite/Core/Component/Image/Cropper.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)