[SERVER-50772] Decoration class should assert the decorated object is not null Created: 04/Sep/20 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | A. Jesse Jiryu Davis | Assignee: | Backlog - Service Architecture |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Service Arch
|
| Sprint: | Service Arch 2022-05-02 |
| Participants: |
| Description |
|
At least twice, I have spent minutes or hours debugging a crash at a line like this:
Eventually, I will realize that my code crashes because opCtx is nullptr. If this is a common mistake, we could speed up debugging it by asserting in Decorable::Decorator::operator () that the pointer to the decorated object is not null |
| Comments |
| Comment by Matt Diener (Inactive) [ 02/May/22 ] |
|
I think it's worth doing this. |
| Comment by Lauren Lewis (Inactive) [ 21/Dec/21 ] |
|
We haven’t heard back from you in at least 1 year, so I'm going to close this ticket. If this is still an issue for you, please provide additional information and we will reopen the ticket. |