mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 04:11:05 +08:00
Fix Nil pointer if GPU does not provide device info (#3108)
* Fix Nil pointer if GPU does not provide device info * Updated changelog format --------- Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
This commit is contained in:
parent
975c55a3d5
commit
e3af0945d0
@ -104,6 +104,10 @@ func diagnoseEnvironment(f *flags.Doctor) error {
|
|||||||
if len(gpu.GraphicsCards) > 1 {
|
if len(gpu.GraphicsCards) > 1 {
|
||||||
prefix = "GPU " + strconv.Itoa(idx+1) + " "
|
prefix = "GPU " + strconv.Itoa(idx+1) + " "
|
||||||
}
|
}
|
||||||
|
if card.DeviceInfo == nil {
|
||||||
|
systemTabledata = append(systemTabledata, []string{prefix, "Unknown"})
|
||||||
|
continue
|
||||||
|
}
|
||||||
details := fmt.Sprintf("%s (%s) - Driver: %s", card.DeviceInfo.Product.Name, card.DeviceInfo.Vendor.Name, card.DeviceInfo.Driver)
|
details := fmt.Sprintf("%s (%s) - Driver: %s", card.DeviceInfo.Product.Name, card.DeviceInfo.Vendor.Name, card.DeviceInfo.Driver)
|
||||||
systemTabledata = append(systemTabledata, []string{prefix, details})
|
systemTabledata = append(systemTabledata, []string{prefix, details})
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Segfault in `wails doctor` when GPU device information is not provided. Thanks to [@atterpac](https://github.com/atterpac) for the fix ([#3108](https://github.com/wailsapp/wails/pull/3108)).
|
||||||
|
|
||||||
## v2.7.0 - 2023-12-09
|
## v2.7.0 - 2023-12-09
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
Loading…
Reference in New Issue
Block a user