Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Call to a member function validateAndSecure() on false #17463

Open
diderich opened this issue May 12, 2024 · 0 comments
Open

[bug] Call to a member function validateAndSecure() on false #17463

diderich opened this issue May 12, 2024 · 0 comments

Comments

@diderich
Copy link

馃悶 bug report

鈦夛笍 Describe the bug

When running the mail scanner (interactively or via cron) and there is an issue with the attachments, the function validateAndSecure() may be called when the object does not exist, i.e. when the creating function in app/Fields/File.php static::loadFromFileor static::loadFromUrl returns false or null.

To correct this, ensure that validateAndSecure() is only called on a proper object, for example by replacing

if($fileInstance->validateAndSecure()) {

with

if($fileInstance !== false && $fileInstance !== null && $fileInstance->validateAndSecure())

馃實 Your Environment

Environment Version / Name
YetiForce 7.0.1
PHP 8.3.7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant