Skip to content

Commit f5814b9

Browse files
committed
check if dir exists before getting subdirs
1 parent 726d14e commit f5814b9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Runtime/LLMUnitySetup.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,10 @@ static async Task DownloadAndExtractInsideDirectory(string url, string path, str
400400
static void DeleteEarlierVersions()
401401
{
402402
List<string> assetPathSubDirs = new List<string>();
403-
assetPathSubDirs.AddRange(Directory.GetDirectories(GetAssetPath()));
404-
assetPathSubDirs.AddRange(Directory.GetDirectories(Path.Combine(Application.dataPath, "Plugins", "Android")));
403+
foreach (string dir in new string[]{GetAssetPath(), Path.Combine(Application.dataPath, "Plugins", "Android")})
404+
{
405+
if(Directory.Exists(dir)) assetPathSubDirs.AddRange(Directory.GetDirectories(dir));
406+
}
405407

406408
Regex regex = new Regex(GetLibraryName("(.+)"));
407409
foreach (string assetPathSubDir in assetPathSubDirs)

0 commit comments

Comments
 (0)