{"record":{"id":"1d9b1ab86aa064f7","repo":"Unity-Technologies/UnityCsReference","slug":"path","errorCode":null,"errorMessage":"path","messagePattern":"path","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Editor/Mono/AssetDatabase/AssetDatabase.cs","lineNumber":136,"sourceCode":"            if (assetOrMetaFilePaths == null)\n                throw new ArgumentNullException(nameof(assetOrMetaFilePaths));\n            if (outNotEditablePaths == null)\n                throw new ArgumentNullException(nameof(outNotEditablePaths));\n            UnityEngine.Profiling.Profiler.BeginSample(\"AssetDatabase.IsOpenForEdit\");\n            AssetModificationProcessorInternal.IsOpenForEdit(assetOrMetaFilePaths, outNotEditablePaths, statusQueryOptions);\n            UnityEngine.Profiling.Profiler.EndSample();\n        }\n\n        [RequiredByNativeCode]\n        private static bool Internal_MakeEditable(string path)\n        {\n            return MakeEditable(path);\n        }\n\n        public static bool MakeEditable(string path)\n        {\n            if (path == null)\n                throw new ArgumentNullException(nameof(path));\n            return MakeEditable(new[] {path});\n        }\n\n        [RequiredByNativeCode]\n        private static bool Internal_MakeEditable2(string[] paths, string prompt = null, List<string> outNotEditablePaths = null)\n        {\n            return MakeEditable(paths, prompt, outNotEditablePaths);\n        }\n\n        public static bool MakeEditable(string[] paths, string prompt = null, List<string> outNotEditablePaths = null)\n        {\n            if (paths == null)\n                throw new ArgumentNullException(nameof(paths));\n            UnityEngine.Profiling.Profiler.BeginSample(\"AssetDatabase.MakeEditable\");\n            ChangeSet changeSet = null;\n            var result = Provider.HandlePreCheckoutCallback(ref paths, ref changeSet);\n            if (result && !AssetModificationProcessorInternal.MakeEditable(paths, prompt, outNotEditablePaths))\n                result = false;","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/AssetDatabase/AssetDatabase.cs#L118-L154","documentation":"The single-path overload of AssetDatabase.MakeEditable delegates to the array overload via MakeEditable(new[] {path}). It throws ArgumentNullException when path is null, because the null guard runs before the array wrapping and before any version-control checkout logic. MakeEditable marks an asset as editable (checks it out) in the active version-control provider.","triggerScenarios":"Calling AssetDatabase.MakeEditable(null) directly, or passing an asset path variable that was set from a query returning null (e.g., AssetDatabase.GUIDToAssetPath on an invalid GUID returns empty string, but other path APIs can return null).","commonSituations":"Custom checkout scripts, import post-processors, or tools that auto-checkout assets before modification where the path source can be null due to a missing asset, deleted file, or unresolvable GUID.","solutions":["Guard the path: if (!string.IsNullOrEmpty(path)) AssetDatabase.MakeEditable(path).","Ensure the path source (GUIDToAssetPath, Selection.activeObject, etc.) is validated and non-null before use.","Use a helper that returns empty string instead of null from path-resolution logic."],"exampleFix":"// before\nAssetDatabase.MakeEditable(resolvedPath);\n\n// after\nif (!string.IsNullOrEmpty(resolvedPath))\n    AssetDatabase.MakeEditable(resolvedPath);","handlingStrategy":"validation","validationCode":"if (!string.IsNullOrEmpty(path))\n    AssetDatabase.MakeEditable(path);","typeGuard":"static bool IsValidAssetPath(string path) => !string.IsNullOrEmpty(path);","tryCatchPattern":"try { AssetDatabase.MakeEditable(path); }\ncatch (ArgumentNullException ex) when (ex.ParamName == \"path\")\n{ Debug.LogWarning($\"Cannot make editable: path is null\"); }","preventionTips":["Validate asset paths with string.IsNullOrEmpty before VCS calls","Ensure path sources (GUIDToAssetPath, Selection) are checked for null/empty","Cache resolved paths and validate them before checkout operations"],"tags":["unity","csharp","asset-database","version-control","null-check","argument-validation"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}