-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Comments
@AleysianAlecK that sounds like a fine fix and I'll include it as such in the next version as well. Thanks for reporting! |
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?) |
@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. |
Okay amazing! Thank you so much! |
…ll (which is sometimes set internally by the framework for performance reasons) does not cause issues when trying to log
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: []
The text was updated successfully, but these errors were encountered: