{"record":{"id":"0811ba937939a875","repo":"AvaloniaUI/Avalonia","slug":"handle-is-not-initialized","errorCode":null,"errorMessage":"Handle is not initialized.","messagePattern":"Handle is not initialized\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"warning","filePath":"src/Avalonia.Base/Collections/Pooled/ThrowHelper.cs","lineNumber":330,"sourceCode":"            throw new InvalidOperationException(\"Invalid enumerator state: enumeration cannot proceed.\");\n        }\n\n        [DoesNotReturn]\n        internal static void ThrowInvalidOperationException_InvalidOperation_NoValue()\n        {\n            throw new InvalidOperationException(\"No value provided.\");\n        }\n\n        [DoesNotReturn]\n        internal static void ThrowInvalidOperationException_ConcurrentOperationsNotSupported()\n        {\n            throw new InvalidOperationException(\"Concurrent operations are not supported.\");\n        }\n\n        [DoesNotReturn]\n        internal static void ThrowInvalidOperationException_HandleIsNotInitialized()\n        {\n            throw new InvalidOperationException(\"Handle is not initialized.\");\n        }\n\n        [DoesNotReturn]\n        internal static void ThrowFormatException_BadFormatSpecifier()\n        {\n            throw new FormatException(\"Bad format specifier.\");\n        }\n\n        private static ArgumentException GetArgumentException(ExceptionResource resource)\n        {\n            return new ArgumentException(GetResourceString(resource));\n        }\n\n        private static InvalidOperationException GetInvalidOperationException(ExceptionResource resource)\n        {\n            return new InvalidOperationException(GetResourceString(resource));\n        }\n","sourceCodeStart":312,"sourceCodeEnd":348,"githubUrl":"https://github.com/AvaloniaUI/Avalonia/blob/11c542726898ae954a1ef668c65ec79ec92ab17d/src/Avalonia.Base/Collections/Pooled/ThrowHelper.cs#L312-L348","documentation":"Centralized ThrowHelper.ThrowInvalidOperationException_HandleIsNotInitialized throws InvalidOperationException \"Handle is not initialized.\" It is a vestigial helper (BCL-origin) for an uninitialized native/OS handle scenario. In this Avalonia codebase it has no active call site; the Pooled collections never reference a handle that could be uninitialized, so it is unused dead code.","triggerScenarios":"Not reachable through public Avalonia collection APIs — no method calls this helper. Would only be hit from a custom/internal caller that a fork wires up.","commonSituations":"Appearance implies a fork or custom caller; otherwise it is unreachable. The PooledList/PooledStack APIs do not deal in handles.","solutions":["Unreachable via public APIs — confirm there is no internal/forked caller.","If you maintain a caller, ensure the handle/resource is initialized before use.","Treat an unexpected occurrence as a signal to inspect the call stack."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Unreachable via public collection APIs. If you maintain a handle-based caller,\n// ensure the handle is initialized before use.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not call internal ThrowHelper methods from product code.","Initialize handles/resources before first use in any forked caller.","Treat an unexpected occurrence as a signal to inspect the call stack."],"tags":["csharp","pooled","throwhelper","handle","unreachable"],"backgroundTag":null,"analyzedSha":"11c542726898ae954a1ef668c65ec79ec92ab17d","analyzedAt":"2026-08-13T11:57:40.261Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}