Skip to content

"Find Unreferenced Assets" has many false positives #2319

Description

@Crystal-Shard

Describe the bug

The game Valdis Story: Abyssal City can be opened in UndertaleModTool and appears to be fully compatible, except that the Find Unreferenced Assets menu option doesn't work.

With 'strings' deselected, it reports many false positives among unreferenced assets.
With 'strings' selected, a null pointer exception occurs.

Reproducing steps

  1. use Find Unreferenced Assets from the menu
  2. select every type of asset in the menu, except for string
  3. I get a list showing pretty much every asset in the game. Apparently UMT detects every asset as unreferenced.

Alternatively:

  1. use Find Unreferenced Assets from the menu
  2. select every type of asset in the menu, including string
  3. I get the error "Value cannot be null. (Parameter 'source')" and a stack trace, shown below.
  4. No results are displayed; EMT does not crash and continues functioning normally.
System.AggregateException: One or more errors occurred. (Value cannot be null. (Parameter 'source')) (Value cannot be null. (Parameter 'source')) (Value cannot be null. (Parameter 'source')) (Value cannot be null. (Parameter 'source'))
 ---> System.ArgumentNullException: Value cannot be null. (Parameter 'source')
   at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate)
   at UndertaleModTool.Windows.UndertaleResourceReferenceMethodsMap.<>c.<.cctor>b__9_42(Object objSrc, HashSetTypesOverride types, Boolean checkOne) in D:\a\UndertaleModTool\UndertaleModTool\UndertaleModTool\Windows\FindReferencesTypesDialog\UndertaleResourceReferenceMethodsMap.cs:line 455
   at UndertaleModTool.Windows.UndertaleResourceReferenceMethodsMap.GetReferencesOfObject(Object obj, UndertaleData data, HashSetTypesOverride types, Boolean checkOne) in D:\a\UndertaleModTool\UndertaleModTool\UndertaleModTool\Windows\FindReferencesTypesDialog\UndertaleResourceReferenceMethodsMap.cs:line 1418
   at UndertaleModTool.Windows.UndertaleResourceReferenceMethodsMap.<>c__DisplayClass7_0.<GetUnreferencedObjects>b__3(Tuple`2 range) in D:\a\UndertaleModTool\UndertaleModTool\UndertaleModTool\Windows\FindReferencesTypesDialog\UndertaleResourceReferenceMethodsMap.cs:line 1532
   at System.Threading.Tasks.Parallel.<>c__DisplayClass43_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass43_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.TaskReplicator.Run[TState](ReplicatableUserAction`1 action, ParallelOptions options, Boolean stopOnFirstFailure)
   at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal](Partitioner`1 source, ParallelOptions parallelOptions, Action`1 simpleBody, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal](Partitioner`1 source, ParallelOptions parallelOptions, Action`1 simpleBody, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.ForEach[TSource](Partitioner`1 source, Action`1 body)
   at UndertaleModTool.Windows.UndertaleResourceReferenceMethodsMap.<>c__DisplayClass7_2.<GetUnreferencedObjects>b__2() in D:\a\UndertaleModTool\UndertaleModTool\UndertaleModTool\Windows\FindReferencesTypesDialog\UndertaleResourceReferenceMethodsMap.cs:line 1525
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at UndertaleModTool.Windows.UndertaleResourceReferenceMethodsMap.GetUnreferencedObjects(UndertaleData data, Dictionary`2 typesDict) in D:\a\UndertaleModTool\UndertaleModTool\UndertaleModTool\Windows\FindReferencesTypesDialog\UndertaleResourceReferenceMethodsMap.cs:line 1523
   at UndertaleModTool.Windows.UndertaleResourceReferenceMethodsMap.GetUnreferencedObjects(UndertaleData data, Dictionary`2 typesDict) in D:\a\UndertaleModTool\UndertaleModTool\UndertaleModTool\Windows\FindReferencesTypesDialog\UndertaleResourceReferenceMethodsMap.cs:line 1594
   at UndertaleModTool.Windows.FindReferencesTypesDialog.SearchButton_Click(Object sender, RoutedEventArgs e) in D:\a\UndertaleModTool\UndertaleModTool\UndertaleModTool\Windows\FindReferencesTypesDialog\FindReferencesTypesDialog.xaml.cs:line 193
 ---> (Inner Exception #1) System.ArgumentNullException: Value cannot be null. (Parameter 'source')
   at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate)
   at UndertaleModTool.Windows.UndertaleResourceReferenceMethodsMap.<>c.<.cctor>b__9_42(Object objSrc, HashSetTypesOverride types, Boolean checkOne) in D:\a\UndertaleModTool\UndertaleModTool\UndertaleModTool\Windows\FindReferencesTypesDialog\UndertaleResourceReferenceMethodsMap.cs:line 455
   at UndertaleModTool.Windows.UndertaleResourceReferenceMethodsMap.GetReferencesOfObject(Object obj, UndertaleData data, HashSetTypesOverride types, Boolean checkOne) in D:\a\UndertaleModTool\UndertaleModTool\UndertaleModTool\Windows\FindReferencesTypesDialog\UndertaleResourceReferenceMethodsMap.cs:line 1418
   at UndertaleModTool.Windows.UndertaleResourceReferenceMethodsMap.<>c__DisplayClass7_0.<GetUnreferencedObjects>b__3(Tuple`2 range) in D:\a\UndertaleModTool\UndertaleModTool\UndertaleModTool\Windows\FindReferencesTypesDialog\UndertaleResourceReferenceMethodsMap.cs:line 1532
   at System.Threading.Tasks.Parallel.<>c__DisplayClass43_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass43_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---

 ---> (Inner Exception #2) System.ArgumentNullException: Value cannot be null. (Parameter 'source')
   at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate)
   at UndertaleModTool.Windows.UndertaleResourceReferenceMethodsMap.<>c.<.cctor>b__9_42(Object objSrc, HashSetTypesOverride types, Boolean checkOne) in D:\a\UndertaleModTool\UndertaleModTool\UndertaleModTool\Windows\FindReferencesTypesDialog\UndertaleResourceReferenceMethodsMap.cs:line 455
   at UndertaleModTool.Windows.UndertaleResourceReferenceMethodsMap.GetReferencesOfObject(Object obj, UndertaleData data, HashSetTypesOverride types, Boolean checkOne) in D:\a\UndertaleModTool\UndertaleModTool\UndertaleModTool\Windows\FindReferencesTypesDialog\UndertaleResourceReferenceMethodsMap.cs:line 1418
   at UndertaleModTool.Windows.UndertaleResourceReferenceMethodsMap.<>c__DisplayClass7_0.<GetUnreferencedObjects>b__3(Tuple`2 range) in D:\a\UndertaleModTool\UndertaleModTool\UndertaleModTool\Windows\FindReferencesTypesDialog\UndertaleResourceReferenceMethodsMap.cs:line 1532
   at System.Threading.Tasks.Parallel.<>c__DisplayClass43_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass43_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---

 ---> (Inner Exception #3) System.ArgumentNullException: Value cannot be null. (Parameter 'source')
   at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate)
   at UndertaleModTool.Windows.UndertaleResourceReferenceMethodsMap.<>c.<.cctor>b__9_42(Object objSrc, HashSetTypesOverride types, Boolean checkOne) in D:\a\UndertaleModTool\UndertaleModTool\UndertaleModTool\Windows\FindReferencesTypesDialog\UndertaleResourceReferenceMethodsMap.cs:line 455
   at UndertaleModTool.Windows.UndertaleResourceReferenceMethodsMap.GetReferencesOfObject(Object obj, UndertaleData data, HashSetTypesOverride types, Boolean checkOne) in D:\a\UndertaleModTool\UndertaleModTool\UndertaleModTool\Windows\FindReferencesTypesDialog\UndertaleResourceReferenceMethodsMap.cs:line 1418
   at UndertaleModTool.Windows.UndertaleResourceReferenceMethodsMap.<>c__DisplayClass7_0.<GetUnreferencedObjects>b__3(Tuple`2 range) in D:\a\UndertaleModTool\UndertaleModTool\UndertaleModTool\Windows\FindReferencesTypesDialog\UndertaleResourceReferenceMethodsMap.cs:line 1532
   at System.Threading.Tasks.Parallel.<>c__DisplayClass43_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass43_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---

Setup Details

  1. UndertaleModTool 0.8.4.1
  2. Windows 11 Home, 25H2; OS build 26200.7623; Experience Pack 1000.26100.275.0
  3. Valdis Story: Abyssal City can be found on Steam here: https://store.steampowered.com/app/252030/Valdis_Story_Abyssal_City/
    game version 1.0.0.25; UMT reports internal version GMS 1.0.0.1224 bytecode 13

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions