Environment
Windows 11 Insider Preview 10.0.28020.1495
Description
When selecting "CLSIDs by Local Server" in the registry viewer, the list fails to load and nothing is displayed.
This is caused by a NullReferenceException that occurs when the application encounters local services with a null ImagePath.
I have modified Forms\COMRegistryViewer.cs to handle null values safely.
- Update COMCLSIDServerEqualityComparer to handle null Server strings safely.
- Ensure ImagePath is converted to an empty string if it is null before creating a COMCLSIDServerEntry.
// In Forms\COMRegistryViewer.cs
// 1. Update COMCLSIDServerEqualityComparer
private class COMCLSIDServerEqualityComparer : IEqualityComparer<COMCLSIDServerEntry>
{
public bool Equals(COMCLSIDServerEntry x, COMCLSIDServerEntry y)
{
// Use static string.Equals to handle nulls
return string.Equals(x.Server, y.Server, StringComparison.OrdinalIgnoreCase);
}
public int GetHashCode(COMCLSIDServerEntry obj)
{
// Handle null Server property
return (obj.Server ?? string.Empty).ToLower().GetHashCode();
}
}
// 2. Update LoadCLSIDByServer method
// ... inside the loop ...
if (!string.IsNullOrEmpty(local_service.ServiceDll))
{
curr_server = new COMCLSIDServerEntry(COMServerType.LocalServer32, local_service.ServiceDll);
}
else
{
// Coalesce null ImagePath to empty string
curr_server = new COMCLSIDServerEntry(COMServerType.LocalServer32, local_service.ImagePath ?? string.Empty);
}
Environment
Windows 11 Insider Preview 10.0.28020.1495Description
When selecting "CLSIDs by Local Server" in the registry viewer, the list fails to load and nothing is displayed. This is caused by a NullReferenceException that occurs when the application encounters local services with a null ImagePath.I have modified Forms\COMRegistryViewer.cs to handle null values safely.