{"record":{"id":"84ed30682dd73c53","repo":"BCUninstaller/Bulk-Crap-Uninstaller","slug":"selected-tab-is-invalid-or-not-supported","errorCode":null,"errorMessage":"Selected tab is invalid or not supported.","messagePattern":"Selected tab is invalid or not supported\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"source/BulkCrapUninstaller/Functions/AppPropertiesGatherer.cs","lineNumber":54,"sourceCode":"        {\r\n            try\r\n            {\r\n                switch (infoType)\r\n                {\r\n                    case InfoType.Overview:\r\n                        return ExtractOverview(entry);\r\n\r\n                    case InfoType.FileInfo:\r\n                        return ExtractFileInfo(entry);\r\n\r\n                    case InfoType.Registry:\r\n                        return ExtractRegistryInfo(entry);\r\n\r\n                    case InfoType.Certificate:\r\n                        return ExtractCertificateInfo(entry);\r\n\r\n                    default:\r\n                        throw new InvalidOperationException(\"Selected tab is invalid or not supported.\");\r\n                }\r\n            }\r\n            catch (Exception ex)\r\n            {\r\n                return GetError(ex.Message);\r\n            }\r\n        }\r\n\r\n        private static void ConvertPropertiesIntoDataTable(IEnumerable<SingleProperty> lq, DataTable dt)\r\n        {\r\n            foreach (var kvp in lq.OrderBy(x => x.Key))\r\n            {\r\n                if (kvp.Value == null)\r\n                    continue;\r\n\r\n                if (kvp.Value is Guid guid && guid.IsEmpty())\r\n                    continue;\r\n\r","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/BCUninstaller/Bulk-Crap-Uninstaller/blob/608321de98e92297377b1eb69029af55c25504a1/source/BulkCrapUninstaller/Functions/AppPropertiesGatherer.cs#L36-L72","documentation":"AppPropertiesGatherer.GetInfo switches on the InfoType enum and hits the default branch. This fires for InfoType.Invalid (=0) or any InfoType value not covered by the Overview/FileInfo/Registry/Certificate cases. In normal UI flow the tab mapping never produces such a value, so it signals a logic bug or a new enum member added without a matching case. The exception is caught and shown as an error table.","triggerScenarios":"Calling GetInfo with InfoType.Invalid; a future enum value added to InfoType without a corresponding case; default(int) cast to InfoType; deserialization yielding the default enum value 0.","commonSituations":"A new tab type added during development without updating the switch; an entry/tab pairing that resolves to InfoType.Invalid.","solutions":["Ensure only valid InfoType values (Overview, FileInfo, Registry, Certificate) are passed to GetInfo.","Add a case for any new InfoType member and keep the switch exhaustive.","Guard callers so InfoType.Invalid never reaches GetInfo."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (infoType == InfoType.Invalid || !Enum.IsDefined(typeof(InfoType), infoType))\n    return GetError(\"Unsupported tab\");","typeGuard":"static bool IsValidTab(InfoType t) =>\n    t == InfoType.Overview || t == InfoType.FileInfo ||\n    t == InfoType.Registry || t == InfoType.Certificate;","tryCatchPattern":null,"preventionTips":["Keep the InfoType switch exhaustive when adding enum members.","Reject InfoType.Invalid at the call site before dispatch."],"tags":["enum","switch","properties-window","logic-bug"],"backgroundTag":null,"analyzedSha":"608321de98e92297377b1eb69029af55c25504a1","analyzedAt":"2026-08-13T12:17:35.389Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}