Unusedfiles command can cause a crash

Kiwi Shark

Member
Community Veteran
Forum Assistant
Oct 10, 2025
423
376

Game Version

2026.6.7.4631

Operating System

Windows 11

What Happened​

When attempting to submit a path for unusedfiles using / the game crashes. Any time unusedfiles is used with / in the filter parameter the game crashes.

What Was Expected​

The game should not crash. The character should be handled or an error message displayed in console.

Reproduction Steps​

  1. Launch game and open the console.
  2. Enter and run "unusedfiles Core/".
  3. Game crashes.

Reproduction Rate​

Always

Additional Info​

From the logs:
ERROR Unhandled exception System.Exception: Error in Window.OnKey callback
---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Program Files\Kitten Space Agency\Content\test'.
at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
at System.IO.Enumeration.FileSystemEnumerator`1.Init()
at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles(String directory, String expression, EnumerationOptions options)
at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions enumerationOptions)
at System.IO.Directory.GetFiles(String path, String searchPattern, EnumerationOptions enumerationOptions)
at KSA.ModLibrary.UnusedFilesToConsole(String input)
at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
--- End of inner exception stack trace ---
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Brutal.ImGuiApi.Abstractions.Command.Issue(String[] args)
at Brutal.ImGuiApi.Abstractions.TerminalInterface.ProcessCommand(String inCommandString)
at Brutal.ImGuiApi.Abstractions.TerminalInterface.Execute(String inInput)
at Brutal.ImGuiApi.Abstractions.ConsoleWindow.Submit()
at Brutal.ImGuiApi.Abstractions.ConsoleWindow.HandleInputAction(Actions action)
at KSA.ConsoleWindowEx.OnKey(ConsoleWindow console, GlfwWindow window, GlfwKey key, Int32 scanCode, GlfwKeyAction action, GlfwModifier mods)
at KSA.Program.OnKey(GlfwWindow window, GlfwKey key, Int32 scanCode, GlfwKeyAction action, GlfwModifier mods)
at Brutal.GlfwApi.GlfwWindow.<.ctor>b__6_10(GlfwWindowHandle* _, Int32 key, Int32 scanCode, Int32 action, Int32 mods)
--- End of inner exception stack trace ---
at Brutal.GlfwApi.Glfw.PollEvents()
at KSA.Program.PrepareFrame(Double currentPlayerTime, Double dtPlayer)
at KSA.Program.OnFrame(Double currentPlayerTime, Double dtPlayer)
at KSA.App.Run()
at KSA.Program.Main(String[] inArgs).
 
Upvote 0
This crash does not happen in other commands such as generatestarbinary.