{"record":{"id":"fa00c663ae5ef5bb","repo":"pentaho/pentaho-kettle","slug":"baseidoralias","errorCode":null,"errorMessage":"baseIdOrAlias","messagePattern":"baseIdOrAlias","errorType":"validation","errorClass":"ArgumentRequiredError","httpStatus":null,"severity":"error","filePath":"plugins/core-ui/src/main/resources/app/pentaho/_core/module/TypeMeta.js","lineNumber":127,"sourceCode":"       *\n       * @param {pentaho.module.InstanceMeta} instance - The instance module.\n       * @private\n       * @internal\n       */\n      __addInstance: function(instance) {\n        var instances = O.getOwn(this, \"__instances\", null);\n        if(instances === null) {\n          this.__instances = instances = [];\n        }\n\n        instances.push(instance);\n      },\n      // endregion\n\n      /** @inheritDoc  */\n      isSubtypeOf: function(baseIdOrAlias) {\n        if(!baseIdOrAlias) {\n          throw new ArgumentRequiredError(\"baseIdOrAlias\");\n        }\n\n        var baseModule = typeof baseIdOrAlias === \"string\"\n          ? core.moduleMetaService.get(baseIdOrAlias, keyArgsAssertDefined)\n          : baseIdOrAlias;\n\n        if(!(baseModule instanceof TypeMeta)) {\n          throw new ArgumentInvalidError(\"baseIdOrAlias\", \"Must be or identify a type module.\");\n        }\n\n        var subModule = this;\n        do {\n          if(baseModule === subModule) {\n            return true;\n          }\n\n          subModule = subModule.ancestor;\n        } while(subModule !== null);","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core-ui/src/main/resources/app/pentaho/_core/module/TypeMeta.js#L109-L145","documentation":"TypeMeta.isSubtypeOf(baseIdOrAlias) checks whether this type module is a subtype of the given base type. The library throws ArgumentRequiredError when called without a base argument (null/undefined), because the comparison target is meaningless without it.","triggerScenarios":"Calling typeMeta.isSubtypeOf() with no argument, or explicitly passing null/undefined as baseIdOrAlias.","commonSituations":"Programmatically derived base ids that resolve to null/undefined (e.g. a config lookup returning undefined) before calling isSubtypeOf; typos in variable names passing an uninitialized value.","solutions":["Ensure a non-empty base id or TypeMeta instance is computed before calling isSubtypeOf","Guard the call: if (baseId) { ... isSubtypeOf(baseId) }","Log/inspect where baseIdOrAlias comes from to find why it is null"],"exampleFix":"// before\nvar isSub = someType.isSubtypeOf(cfg.baseType);\n// after\nif (cfg.baseType == null) throw new Error('Config baseType is required');\nvar isSub = someType.isSubtypeOf(cfg.baseType);","handlingStrategy":"validation","validationCode":"if (baseIdOrAlias == null) throw new Error('isSubtypeOf requires a base type id or TypeMeta');","typeGuard":"function isValidBase(b) { return typeof b === 'string' && b.length > 0 || b instanceof TypeMeta; }","tryCatchPattern":"try { return type.isSubtypeOf(baseId); } catch (e) { if (e instanceof ArgumentRequiredError) { /* fall back: treat as not subtype */ return false; } throw e; }","preventionTips":["Never pass config-derived values straight into isSubtypeOf without a null check","Resolve base ids through moduleMetaService.get once and reuse the TypeMeta","Enable strict null checks in your own code around module metadata"],"tags":["argument-validation","required-parameter","type-system"],"backgroundTag":"missing-required-argument","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}