{"record":{"id":"2676ac1dcdb5866f","repo":"HandyOrg/HandyControl","slug":"owner","errorCode":null,"errorMessage":"owner","messagePattern":"owner","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Shared/HandyControl_Shared/Data/GlowWindow/GlowEdge.cs","lineNumber":58,"sourceCode":"    private bool _isActive;\n\n    private bool _isVisible;\n\n    private int _left;\n\n    private bool _pendingDelayRender;\n\n    private int _top;\n\n    private int _width;\n\n    internal static long CreatedGlowEdges { get; private set; }\n\n    internal static long DisposedGlowEdges { get; private set; }\n\n    internal GlowEdge(GlowWindow owner, Dock orientation)\n    {\n        _targetWindow = owner ?? throw new ArgumentNullException(nameof(owner));\n        _orientation = orientation;\n        CreatedGlowEdges += 1L;\n    }\n\n    private bool IsDeferringChanges => _targetWindow.DeferGlowChangesCount > 0;\n\n    private static ushort SharedWindowClassAtom\n    {\n        get\n        {\n            if (_sharedWindowClassAtom == 0)\n            {\n                var wndclass = default(InteropValues.WNDCLASS);\n\n                wndclass.cbClsExtra = 0;\n                wndclass.cbWndExtra = 0;\n                wndclass.hbrBackground = IntPtr.Zero;\n                wndclass.hCursor = IntPtr.Zero;","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/HandyOrg/HandyControl/blob/2c0875ebd67326e0c67282967e3e809c69282fee/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowEdge.cs#L40-L76","documentation":"The internal GlowEdge constructor requires a GlowWindow owner to know which window it decorates, and throws ArgumentNullException(nameof(owner)) when null is passed. The edge also tracks CreatedGlowEdges/DisposedGlowEdges counters and delegates state (like IsDeferringChanges) to the owner window, so a null owner is unusable.","triggerScenarios":"Constructing GlowEdge directly with a null GlowWindow (e.g. reflection, a custom glow implementation, or DI mistakenly supplying null).","commonSituations":"Custom window chrome code instantiating glow edges manually instead of letting GlowWindow create them; refactoring that breaks the owner window creation order.","solutions":["Let GlowWindow create its own edges internally instead of constructing GlowEdge yourself (the constructor is internal).","If you must construct it, pass the live GlowWindow instance and verify it is non-null before the call.","Ensure dependency injection or reflection code resolves the GlowWindow correctly and is not passing null."],"exampleFix":"// before\nvar edge = new GlowEdge(null, Dock.Top);\n// after\nvar glowWindow = new GlowWindow();\nvar edge = new GlowEdge(glowWindow, Dock.Top); // owner must be the live window","handlingStrategy":"validation","validationCode":"if (owner == null) throw new InvalidOperationException(\"GlowEdge requires a live GlowWindow owner\");\nvar edge = new GlowEdge(owner, dock);","typeGuard":"static bool HasOwner(GlowWindow owner) => owner != null;","tryCatchPattern":"try { var edge = new GlowEdge(owner, dock); } catch (ArgumentNullException) { // owner was null; create the GlowWindow first or skip the edge\n}","preventionTips":["Prefer letting GlowWindow create its glow edges internally rather than constructing GlowEdge manually.","Verify the GlowWindow instance is constructed and non-null before any dependent child creation.","Check DI/reflective construction paths for missing owner registrations."],"tags":["glow-window","null","argument","constructor"],"backgroundTag":"null-argument","analyzedSha":"2c0875ebd67326e0c67282967e3e809c69282fee","analyzedAt":"2026-09-14T14:45:29.754Z","contentChangedAt":"2026-09-14T14:45:29.754Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}