Skip to content

Crash (NullReferenceException) in XboxGamingBarHelper on startup when ADLX fails to initialize #116

Description

@jeremidelacruz

The XboxGamingBarHelper.exe crashes immediately on startup and gets stuck in a loop, resulting in a "Helper not
connected" state and missing tabs (like the Legion tab) in the widget.

### Root cause:
1. In `AMDManager.cs`, if `adlxHelper.Initialize()` returns anything other than `ADLX_RESULT.ADLX_OK`, the

constructor logs "AMD Manager initialize failed." and return;s early.
2. Because it returns early, all the AMD property wrappers (e.g., amdRadeonSuperResolutionEnabled,
amdFluidMotionFrameSupported, etc.) are left as null.
3. In Program.cs, these null properties are directly passed into the HelperProperties constructor.
4. Finally, in FunctionalProperties.cs at the constructor (foreach (var property in inProperties)), the code
tries to evaluate property.Function without checking if property is null, throwing a fatal System. NullReferenceException which crashes the entire Helper process.

### Suggested Fix:
In `Shared\Data\FunctionalProperties.cs`, add a simple null check inside the constructor's `foreach` loop:

```csharp
foreach (var property in inProperties)
{
    if (property == null) continue; // Prevent crash if a manager failed to initialize properties
    if (!properties.ContainsKey(property.Function))
    // ...
}

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions