lauralex / dwm_lut

Apply 3D LUTs to the Windows desktop for system-wide color correction/calibration
GNU General Public License v3.0
246 stars 18 forks source link

Fix crash when a configured monitor is not connected #51

Closed Kazurin-775 closed 8 months ago

Kazurin-775 commented 8 months ago

If some monitor exists in config.xml, but is not connected to the computer when the app launches, the program's control flow will reach MainViewModel.cs#L232, where the program tries to set newMonitorData.HdrLuts = new ObservableCollection<string>(hdrLutPaths).

However, since <hdr_luts /> may not be present in config.xml, hdrLutPaths may be null. This will result in a System.ArgumentNullException being thrown during construction of the ObservableCollection<string>.

This patch fixes the crash by only setting newMonitorData.HdrLuts when the corresponding hdrLutPaths is not null.

lauralex commented 8 months ago

Gonna check