Skip to content

Commit 7f4d387

Browse files
authored
Merge pull request #82 from bromanz/hotfix/reflectionTypeLoadException
System.Reflection.TypeLoadException
2 parents 1cefea1 + a53605b commit 7f4d387

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

Editor/AssetBundleDataSource/ABDataSourceProvider.cs

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,26 @@ private static List<Type> BuildCustomABDataSourceList()
2525
var x = AppDomain.CurrentDomain.GetAssemblies();
2626
foreach (var assembly in x)
2727
{
28-
var list = new List<Type>(
29-
assembly
30-
.GetTypes()
31-
.Where(t => t != typeof(ABDataSource))
32-
.Where(t => typeof(ABDataSource).IsAssignableFrom(t)));
33-
34-
35-
for (int count = 0; count < list.Count; count++)
28+
try
29+
{
30+
var list = new List<Type>(
31+
assembly
32+
.GetTypes()
33+
.Where(t => t != typeof(ABDataSource))
34+
.Where(t => typeof(ABDataSource).IsAssignableFrom(t)));
35+
36+
37+
for (int count = 0; count < list.Count; count++)
38+
{
39+
if (list[count].Name == "AssetDatabaseABDataSource")
40+
properList[0] = list[count];
41+
else if (list[count] != null)
42+
properList.Add(list[count]);
43+
}
44+
}
45+
catch (System.Exception)
3646
{
37-
if (list[count].Name == "AssetDatabaseABDataSource")
38-
properList[0] = list[count];
39-
else if(list[count] != null)
40-
properList.Add(list[count]);
47+
//assembly which raises exception on the GetTypes() call - ignore it
4148
}
4249
}
4350

0 commit comments

Comments
 (0)