Skip to content

Commit 5b6a129

Browse files
author
yapetrichka
committed
fix: Prevent error while export in root folder
1 parent d88fac2 commit 5b6a129

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [0.8.3] - 2024-08-03
4+
- Prevent error while export in root `Assets` folder
5+
- Add installation guide
6+
37
## [0.8.1] - 2023-02-24
48
- Prevent error CS0518: Predefined type 'System.Range'
59

Editor/Reflection/PackageUtility.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ internal static object[] ExtractAndPrepareAssetList(string selectedFolder, strin
2121
{
2222
var exportedAssetPath = (string)exportedAssetPathFieldInfo.GetValue(asset);
2323
var existingAssetPath = (string)existingAssetPathFieldInfo.GetValue(asset);
24-
var destinationPathWithoutRoot =
25-
exportedAssetPath.Substring(exportedAssetPath.IndexOf("/", StringComparison.Ordinal));
24+
var startIndex = exportedAssetPath.IndexOf("/", StringComparison.Ordinal);
25+
if (startIndex == -1)
26+
continue;
27+
var destinationPathWithoutRoot = exportedAssetPath.Substring(startIndex);
2628
var resultPath = selectedFolder + destinationPathWithoutRoot;
2729
if (!string.IsNullOrEmpty(existingAssetPath) && !existingAssetPath.Equals(resultPath))
2830
{

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.dreamcode.editor.smart-importer",
33
"displayName": "SmartImporter",
4-
"version": "0.8.2",
4+
"version": "0.8.3",
55
"unity": "2020.3",
66
"description": "Allows import Unity packages (.unitypackage) to custom folder, ignoring initial assets paths.",
77
"keywords": [

0 commit comments

Comments
 (0)