{"record":{"id":"5776d5a9f3a89dea","repo":"ppy/osu","slug":"invalid-component-type-component","errorCode":null,"errorMessage":"Invalid component type: {component}","messagePattern":"Invalid component type: (.+?)","errorType":"exception","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"osu.Game.Rulesets.Taiko/Skinning/Legacy/TaikoLegacySkinTransformer.cs","lineNumber":247,"sourceCode":"\r\n            return base.GetDrawableComponent(lookup);\r\n        }\r\n\r\n        private string getHitName(TaikoSkinComponents component)\r\n        {\r\n            switch (component)\r\n            {\r\n                case TaikoSkinComponents.TaikoExplosionMiss:\r\n                    return \"taiko-hit0\";\r\n\r\n                case TaikoSkinComponents.TaikoExplosionOk:\r\n                    return \"taiko-hit100\";\r\n\r\n                case TaikoSkinComponents.TaikoExplosionGreat:\r\n                    return \"taiko-hit300\";\r\n            }\r\n\r\n            throw new ArgumentOutOfRangeException(nameof(component), $\"Invalid component type: {component}\");\r\n        }\r\n\r\n        public override ISample? GetSample(ISampleInfo sampleInfo)\r\n        {\r\n            if (sampleInfo is HitSampleInfo hitSampleInfo)\r\n                return base.GetSample(new LegacyTaikoSampleInfo(hitSampleInfo));\r\n\r\n            return base.GetSample(sampleInfo);\r\n        }\r\n\r\n        private class LegacyTaikoSampleInfo : HitSampleInfo\r\n        {\r\n            public LegacyTaikoSampleInfo(HitSampleInfo sampleInfo)\r\n                : base(sampleInfo.Name, sampleInfo.Bank, sampleInfo.Suffix, sampleInfo.Volume, sampleInfo.EditorAutoBank, sampleInfo.UseBeatmapSamples)\r\n\r\n            {\r\n            }\r\n\r","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/ppy/osu/blob/d9c73e12adff2feaae4a3e158d36fe5883faf6ca/osu.Game.Rulesets.Taiko/Skinning/Legacy/TaikoLegacySkinTransformer.cs#L229-L265","documentation":"TaikoLegacySkinTransformer.GetHitExplosionName() maps TaikoSkinComponents explosion types (Miss, Ok, Great) to legacy skin texture filenames. Unhandled component values throw ArgumentOutOfRangeException, preventing an invalid lookup that would produce a null or wrong skin element name.","triggerScenarios":"A TaikoSkinComponents enum value not in the three handled cases (TaikoExplosionMiss, TaikoExplosionOk, TaikoExplosionGreat) is passed to this lookup method — e.g., a non-explosion component or a newly added explosion type.","commonSituations":"A new TaikoSkinComponents explosion member is added without updating this transformer; a routing error that sends a non-explosion component (e.g., TaikoHitTarget, TaikoKiaiGlow) to this method.","solutions":["Add a case for the new TaikoSkinComponents explosion value returning the appropriate legacy skin texture name.","Ensure only explosion-related components are routed to GetHitExplosionName — verify the caller's component selection logic."],"exampleFix":"// before\ncase TaikoSkinComponents.TaikoExplosionGreat:\n    return \"taiko-hit300\";\ndefault:\n    throw new ArgumentOutOfRangeException(nameof(component), $\"Invalid component type: {component}\");\n\n// after — add the missing case\ncase TaikoSkinComponents.TaikoExplosionGreat:\n    return \"taiko-hit300\";\ncase TaikoSkinComponents.TaikoExplosionGood:\n    return \"taiko-hit100-alt\";\ndefault:\n    throw new ArgumentOutOfRangeException(nameof(component), $\"Invalid component type: {component}\");","handlingStrategy":"type-guard","validationCode":"// Validate the component is an explosion type before calling GetHitExplosionName\nstatic bool IsExplosionComponent(TaikoSkinComponents component)\n    => component is TaikoSkinComponents.TaikoExplosionMiss\n        or TaikoSkinComponents.TaikoExplosionOk\n        or TaikoSkinComponents.TaikoExplosionGreat;","typeGuard":"static bool IsExplosionComponent(TaikoSkinComponents component)\n    => component is TaikoSkinComponents.TaikoExplosionMiss\n        or TaikoSkinComponents.TaikoExplosionOk\n        or TaikoSkinComponents.TaikoExplosionGreat;","tryCatchPattern":null,"preventionTips":["When adding a new TaikoSkinComponents explosion type, add the transformer case in the same commit.","Ensure the caller only routes explosion components to GetHitExplosionName — add a routing test.","Use exhaustive switch expressions to get compiler warnings for missing cases."],"tags":["taiko-ruleset","skinning","enum-exhaustiveness","legacy"],"backgroundTag":null,"analyzedSha":"d9c73e12adff2feaae4a3e158d36fe5883faf6ca","analyzedAt":"2026-08-13T14:12:54.015Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}