Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-50772

Decoration class should assert the decorated object is not null

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Internal Code
    • Labels:
      None
    • Service Arch
    • Service Arch 2022-05-02

      At least twice, I have spent minutes or hours debugging a crash at a line like this:

      auto& readConcernArgs = ReadConcernArgs::get(opCtx);
      

      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

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: