Skip to content

Commit

Permalink
Fixed an issue causing a crash on controller disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
Valkirie committed Dec 27, 2024
1 parent 85a4838 commit ab9c024
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions HandheldCompanion/Controllers/IController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,9 @@ public virtual void Unplug()

public bool IsHidden()
{
// bool hide_device = HidHide.IsRegistered(Details.deviceInstanceId);
bool hide_base = HidHide.IsRegistered(Details.baseContainerDeviceInstanceId);
return /* hide_device || */ hide_base;
if (Details is not null)
return HidHide.IsRegistered(Details.baseContainerDeviceInstanceId);
return false;
}

public virtual void Hide(bool powerCycle = true)
Expand Down Expand Up @@ -383,12 +383,18 @@ public virtual void SetLightColor(byte R, byte G, byte B)

protected void HideHID()
{
if (Details is null)
return;

HidHide.HidePath(Details.baseContainerDeviceInstanceId);
HidHide.HidePath(Details.deviceInstanceId);
}

protected void UnhideHID()
{
if (Details is null)
return;

HidHide.UnhidePath(Details.baseContainerDeviceInstanceId);
HidHide.UnhidePath(Details.deviceInstanceId);
}
Expand Down

0 comments on commit ab9c024

Please sign in to comment.