diff --git a/CHANGELOG.md b/CHANGELOG.md index 93027d6..61e8f78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [0.8.3] - 2024-08-03 +- Prevent error while export in root `Assets` folder +- Add installation guide + ## [0.8.1] - 2023-02-24 - Prevent error CS0518: Predefined type 'System.Range' diff --git a/Editor/Reflection/PackageUtility.cs b/Editor/Reflection/PackageUtility.cs index cb6be9f..dc21093 100644 --- a/Editor/Reflection/PackageUtility.cs +++ b/Editor/Reflection/PackageUtility.cs @@ -21,8 +21,10 @@ internal static object[] ExtractAndPrepareAssetList(string selectedFolder, strin { var exportedAssetPath = (string)exportedAssetPathFieldInfo.GetValue(asset); var existingAssetPath = (string)existingAssetPathFieldInfo.GetValue(asset); - var destinationPathWithoutRoot = - exportedAssetPath.Substring(exportedAssetPath.IndexOf("/", StringComparison.Ordinal)); + var startIndex = exportedAssetPath.IndexOf("/", StringComparison.Ordinal); + if (startIndex == -1) + continue; + var destinationPathWithoutRoot = exportedAssetPath.Substring(startIndex); var resultPath = selectedFolder + destinationPathWithoutRoot; if (!string.IsNullOrEmpty(existingAssetPath) && !existingAssetPath.Equals(resultPath)) { diff --git a/package.json b/package.json index 2a9b5c2..e0f16ec 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.dreamcode.editor.smart-importer", "displayName": "SmartImporter", - "version": "0.8.2", + "version": "0.8.3", "unity": "2020.3", "description": "Allows import Unity packages (.unitypackage) to custom folder, ignoring initial assets paths.", "keywords": [