{"record":{"id":"2d0b831758288c98","repo":"stride3d/stride","slug":"list-cannot-contain-null-items","errorCode":null,"errorMessage":"List cannot contain null items","messagePattern":"List cannot contain null items","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"sources/assets/Stride.Core.Assets/Analysis/AssetCollision.cs","lineNumber":39,"sourceCode":"    /// <param name=\"removeUnloadableObjects\">If set to <c>true</c>, assets will be cloned with <see cref=\"AssetClonerFlags.RemoveUnloadableObjects\"/>.</param>\n    /// <exception cref=\"ArgumentNullException\">\n    /// inputItems\n    /// or\n    /// outputItems\n    /// or\n    /// assetResolver\n    /// </exception>\n    /// <exception cref=\"System.ArgumentException\">List cannot contain null items;inputItems</exception>\n    public static void Clean(Package package, ICollection<AssetItem> inputItems, ICollection<AssetItem> outputItems, AssetResolver assetResolver, bool cloneInput, bool removeUnloadableObjects)\n    {\n        ArgumentNullException.ThrowIfNull(inputItems);\n        ArgumentNullException.ThrowIfNull(outputItems);\n        ArgumentNullException.ThrowIfNull(assetResolver);\n\n        // Check that all items are non-null\n        if (inputItems.Any(item => item == null))\n        {\n            throw new ArgumentException(\"List cannot contain null items\", nameof(inputItems));\n        }\n\n        var items = inputItems;\n        if (cloneInput)\n        {\n            items = inputItems.Select(item => item.Clone(flags: removeUnloadableObjects ? AssetClonerFlags.RemoveUnloadableObjects : AssetClonerFlags.None)).ToList();\n        }\n\n        // idRemap should contain only assets that have either 1) their id remapped or 2) their location remapped\n        var idRemap = new Dictionary<AssetId, Tuple<AssetId, UFile>>();\n        var itemRemap = new Dictionary<AssetItem, Tuple<AssetId, UFile>>();\n        foreach (var item in items)\n        {\n            if (outputItems.Contains(item))\n            {\n                continue;\n            }\n","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/assets/Stride.Core.Assets/Analysis/AssetCollision.cs#L21-L57","documentation":"Input validation in AssetCollision.Clean: one of the inputItems/outputItems collections contains a null AssetItem element. The loop over the collections hit a null entry, which the collision-resolution algorithm cannot process.","triggerScenarios":"Thrown at sources/assets/Stride.Core.Assets/Analysis/AssetCollision.cs:39 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove null entries from inputItems/outputItems before calling Clean","Fix the upstream code producing null AssetItems in the collections"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}