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

Decoration class should assert the decorated object is not null

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Internal Code
    • None
    • Service Arch
    • Service Arch 2022-05-02

    Description

      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

      Attachments

        Activity

          People

            backlog-server-servicearch Backlog - Service Architecture
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: