Skip to content

Bug: Bug: ribbon-engines-callers-unguarded-null-deref #518

Description

@drmoisan
  • Work Mode: minor-audit

Summary

All 11 production call sites of RibbonController.Engines dereference the result with no null
guard. Issue #507 changed Engines from Globals.Engines to Globals?.Engines so the property
returns null instead of throwing when Globals is unassigned, matching the sibling SB
precedent. That fix is correct and is the behavior #507 specified, but on its own it relocates the
NullReferenceException rather than eliminating it: the same ribbon click now throws one frame
later, at the call site, instead of inside get_Engines().

Discovered during the feature review of #507 (bug/ribbon-controller-engines-null-unsafe-507).

Environment

  • OS/version: Windows 11, Outlook desktop (VSTO add-in host)
  • Runtime: .NET Framework 4.8.1, TaskMaster VSTO add-in
  • Data source or fixture: Live Outlook profile during add-in startup

Steps to Reproduce

  1. Reload the TaskMaster add-in so the ribbon is constructed before the controller's Globals is
    assigned.
  2. Invoke any of the callbacks listed above.
  3. Observe a NullReferenceException raised at the call site rather than inside get_Engines().

Expected Behavior

Each callback guards the Engines result and degrades gracefully when the engines are not yet
available, rather than dereferencing null.

Actual Behavior

Every call site dereferences Controller.Engines immediately with no guard.

Logs / Screenshots

(not provided in potential file)

Impact / Severity

  • Blocker
  • High
  • Medium
  • Low

Same narrow reachable window as #507: the callback must run before SetGlobals. The affected
callbacks are configuration submenu items rather than primary commands.

Source

From: docs/features/potential/2026-08-08-ribbon-engines-callers-unguarded-null-deref.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions