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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access of RollupControl causes System.NullPointerException during Lead Merge (Contact After Delete) #626

Closed
AleysianAlecK opened this issue Sep 24, 2024 · 4 comments · Fixed by #628

Comments

@AleysianAlecK
Copy link

Line 1906 of Rollup.cls in the hasExceededCurrentRollupLimits method (if (control.IsRollupLoggingEnabled__c == false)) somehow caused a System.NullPointerException when performing a Lead merge, triggered during the Contact After Delete context. I validated that all configured Rollups did indeed have RollupControl records specified.

Since we have the unmanaged version installed, our quick bandaid solution was to add a safe navigation operator in the if statement to allow functionality to proceed. I believe this is fine, since this line only triggers logging upon exceeding limits, but needed to log this for my client's comfort and see if there was anything that we're doing wrong. I do not believe the Rollup code has been modified in any other way.

Full error message:
Error (Merge):System.DmlException: Merge failed. First exception on row 0 with id 0035f00000RJpmYAAT; first error: DELETE_FAILED, ContactTrigger: execution of AfterDelete caused by: System.NullPointerException: Attempt to de-reference a null object Class.Rollup.hasExceededCurrentRollupLimits: line 1906, column 1 Class.RollupSObjectUpdater.doUpdate: line 54, column 1 Class.Rollup.performNonRecursiveUpdate: line 3026, column 1 Class.Rollup.reparentAndGetMergedRecordIds: line 3014, column 1 Class.Rollup.runFromApex: line 1737, column 1 Class.Rollup.runFromTrigger: line 1683, column 1 Trigger.ContactTrigger: line 17, column 1: []

@jamessimone
Copy link
Owner

@AleysianAlecK that sounds like a fine fix and I'll include it as such in the next version as well. Thanks for reporting!

@AleysianAlecK
Copy link
Author

Thank you! :) Do you have any idea why it happened though? If not right now, that's fine!

(Also I don't do this... ever - should I close the ticket?)

@jamessimone
Copy link
Owner

@AleysianAlecK don't close it - I'll tag this issue with the fix (which will then auto-close when I merge the code for the next version). I will be sure to do a full investigation into how exactly this might happen - the stack trace you included in the original comment should be more than enough to go off of.

@AleysianAlecK
Copy link
Author

Okay amazing! Thank you so much!

jamessimone added a commit that referenced this issue Sep 25, 2024
…ll (which is sometimes set internally by the framework for performance reasons) does not cause issues when trying to log
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

Successfully merging a pull request may close this issue.

2 participants