ctessier / nova-advanced-image-field

🌄 📐 A Laravel Nova advanced image field with cropping and resizing using Vue Advanced Cropper and Intervention Image
https://novapackages.com/packages/ctessier/nova-advanced-image-field
MIT License
100 stars 26 forks source link

[BUGFIX] Allow cropperdata to be null #89

Closed Woeler closed 1 year ago

Woeler commented 1 year ago

If the cropper is disabled, the cropperdata will be null. The docblock above the method also says that it can be null, but the method signature doesnt allow null.

[2023-01-12 10:02:25] local.ERROR: Ctessier\NovaAdvancedImageField\AdvancedImage::transformImage(): Argument #2 ($cropperData) must be of type object, null given, called in /var/www/html/vendor/ctessier/nova-advanced-image-field/src/AdvancedImage.php on line 59 {"userId":1,"exception":"[object] (TypeError(code: 0): Ctessier\\NovaAdvancedImageField\\AdvancedImage::transformImage(): Argument #2 ($cropperData) must be of type object, null given, called in /var/www/html/vendor/ctessier/nova-advanced-image-field/src/AdvancedImage.php on line 59 at /var/www/html/vendor/ctessier/nova-advanced-image-field/src/TransformableImage.php:147)
[stacktrace]
sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

ctessier commented 1 year ago

Pull request released in v2.0.2