DaZombieKiller / TypeTreeDumper

Experimental tool to export type tree information from the Unity editor.
MIT License
46 stars 11 forks source link

Fix null reference exception when calling TryResolveFunction with unknown symbol #5

Closed spacehamster closed 4 years ago

spacehamster commented 4 years ago

Marshal.GetDelegateForFunctionPointer throws a null reference exception when called with a zero value IntPtr

System.ArgumentNullException: Value cannot be null.
Parameter name: ptr
   at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(IntPtr ptr, Type t)
   at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer[TDelegate](IntPtr ptr)
   at Unity.SymbolResolver.TryResolveFunction[T](String name, T& del)
   at Unity.SymbolResolver.ResolveFunction[T](String name)
   at TypeTreeDumper.EntryPoint.Dump()