-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix refetchEntity call timing after Lead instance check #15051
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Prevents calling refetchEntity on null when lead is not found
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ensures that the refetchEntity
method is only called on valid Lead
instances by moving the call below the null/type check.
- Prevents calling
refetchEntity
on a non-Lead
(e.g., null) value. - Adjusts code layout to reflect the new call order.
Comments suppressed due to low confidence (1)
app/bundles/LeadBundle/Controller/LeadDetailsTrait.php:335
- Add a unit test to verify behavior when
getEntity
returns null or a non-Lead instance, ensuring no errors are thrown andrefetchEntity
is not invoked.
if (!$lead instanceof Lead) {
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 6.0 #15051 +/- ##
=========================================
Coverage 64.78% 64.78%
Complexity 34745 34745
=========================================
Files 2276 2276
Lines 103796 103796
=========================================
Hits 67248 67248
Misses 36548 36548
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code change looks fine 👍
Description
This PR fixes a potential issue where
refetchEntity
was being called on a null value when the lead is not found. The fix moves therefetchEntity
call after the null check to ensure it's only called on valid Lead instances.📋 Steps to test this PR: