Skip to content

Commit 9638f5b

Browse files
authored
Merge pull request bdovaz#242 from bdovaz/feature/fix-generating-invalid-meta-files
Prevent the generation of invalid .meta files
2 parents 6b3784b + b8aa900 commit 9638f5b

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/UnityNuGet/RegistryCache.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,17 @@ RegistryEntry packageEntry
748748
// Collect the folders' metas
749749
{
750750
string? fullPath = Path.GetDirectoryName(fileInUnityPackage);
751-
string[] folders = fullPath?.Split(Path.DirectorySeparatorChar) ?? Array.Empty<string>();
751+
string[] folders;
752+
753+
if (!string.IsNullOrEmpty(fullPath))
754+
{
755+
folders = fullPath.Split(Path.DirectorySeparatorChar);
756+
}
757+
else
758+
{
759+
folders = Array.Empty<string>();
760+
}
761+
752762
string folder = string.Empty;
753763

754764
foreach (var relative in folders)

0 commit comments

Comments
 (0)