Valkirie / HandheldCompanion

ControllerService
Other
1.15k stars 89 forks source link

Object reference not set to an instance of an object. at HandheldCompanion.Targets.Xbox360Target #1052

Open CasperH2O opened 4 months ago

CasperH2O commented 4 months ago

Device manufacturer

Device model Legion Go

Handheld Companion Version 0.21.0.1

Describe the bug App crashes.

Observed by techgurutopg on Discord.

To Reproduce Unknown, not consistent.

Logs file

2024-04-24 21:01:18.318 -04:00 [FTL] Object reference not set to an instance of an object.     at HandheldCompanion.Targets.Xbox360Target..ctor(UInt16 vendorId, UInt16 productId) in D:\a\HandheldCompanion\HandheldCompanion\HandheldCompanion\Targets\Xbox360Target.cs:line 22
   at HandheldCompanion.Managers.VirtualManager.SetControllerMode(HIDmode mode) in D:\a\HandheldCompanion\HandheldCompanion\HandheldCompanion\Managers\VirtualManager.cs:line 228
   at HandheldCompanion.Managers.VirtualManager.SettingsManager_SettingValueChanged(String name, Object value) in D:\a\HandheldCompanion\HandheldCompanion\HandheldCompanion\Managers\VirtualManager.cs:line 138
   at HandheldCompanion.Managers.SettingsManager.Start() in D:\a\HandheldCompanion\HandheldCompanion\HandheldCompanion\Managers\SettingsManager.cs:line 53
   at HandheldCompanion.Views.MainWindow..ctor(FileVersionInfo _fileVersionInfo, Assembly CurrentAssembly) in D:\a\HandheldCompanion\HandheldCompanion\HandheldCompanion\Views\Windows\MainWindow.xaml.cs:line 259
   at HandheldCompanion.App.OnStartup(StartupEventArgs args) in D:\a\HandheldCompanion\HandheldCompanion\HandheldCompanion\App.xaml.cs:line 108
   at System.Windows.Application.<.ctor>b__1_0(Object unused)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at HandheldCompanion.App.Main()

HandheldCompanion-20240424.log

Valkirie commented 3 months ago

should be fixed by https://github.com/Valkirie/HandheldCompanion/commit/57db853ff25376899e7f6e4ae84a10f3d60f3f90