mirror of
https://github.com/yasirkula/UnityAssetUsageDetector.git
synced 2026-11-19 14:32:37 +08:00
Fixed an exception that occurs when a VFX Graph window is open and the open VFX Graph asset is searched for references (there may be other similar edge cases, as well)
This commit is contained in:
@@ -985,9 +985,13 @@ namespace AssetUsageDetectorNamespace
|
||||
if( obj == null || obj.Equals( null ) )
|
||||
return null;
|
||||
|
||||
// Avoid recursion (which leads to stackoverflow exception) using a stack
|
||||
if( callStack.ContainsFast( obj ) )
|
||||
return null;
|
||||
// Avoid recursion (which leads to stackoverflow exception) using a stack (initially, I was using callStack.ContainsFast
|
||||
// here but it returned false for objects that do exist in the call stack if VFX Graph window was open)
|
||||
for( int i = callStack.Count - 1; i >= 0; i-- )
|
||||
{
|
||||
if( callStack[i].Equals( obj ) )
|
||||
return null;
|
||||
}
|
||||
|
||||
bool searchingSourceAsset = searchingSourceAssets && ReferenceEquals( currentSearchedObject, obj );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user