Skip to content

Commit

Permalink
Merge pull request #25 from FaithBeam/fix-empty-processes-linux
Browse files Browse the repository at this point in the history
Fix empty processes linux
  • Loading branch information
FaithBeam authored Oct 9, 2024
2 parents 136809d + d3db979 commit bfc2201
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion YMouseButtonControl.Linux/Services/ProcessMonitorService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@ public IEnumerable<ProcessModel> GetProcesses() =>
Process
.GetProcesses()
.Select(x => new ProcessModel(x))
.Where(x => !string.IsNullOrWhiteSpace(x.Process.ProcessName));
.Where(x =>
!string.IsNullOrWhiteSpace(x.Process.MainModule?.ModuleName)
&& !string.IsNullOrWhiteSpace(x.Process.ProcessName)
)
.DistinctBy(x => x.Process.MainModule?.FileName);
}

0 comments on commit bfc2201

Please sign in to comment.