Model: Make Get*() return null instead of throwing exception if no matching item found

This commit is contained in:
Katy Coe
2019-11-09 20:21:31 +01:00
parent 769dd2079d
commit 21d486eb92
2 changed files with 5 additions and 5 deletions

View File

@@ -43,10 +43,10 @@ namespace Il2CppInspector.Reflection
}
// Get an assembly by its name
public Assembly GetAssembly(string name) => Assemblies.First(a => a.FullName == name);
public Assembly GetAssembly(string name) => Assemblies.FirstOrDefault(a => a.FullName == name);
// Get a type by its full name
public TypeInfo GetType(string name) => Types.First(t => t.FullName == name);
public TypeInfo GetType(string name) => Types.FirstOrDefault(t => t.FullName == name);
private TypeInfo getNewTypeUsage(Il2CppType usage, MemberTypes memberType) {
switch (usage.type) {