mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
- fix crash when GPU module is enabled (#74)
This commit is contained in:
@@ -35,7 +35,7 @@ public struct GPUs: value_t {
|
||||
|
||||
public var widget_value: Double {
|
||||
get {
|
||||
return list[0].utilization
|
||||
return list.isEmpty ? 0 : list[0].utilization
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,7 +87,7 @@ public class GPU: Module {
|
||||
}
|
||||
|
||||
private func infoCallback(_ value: GPUs?) {
|
||||
guard value != nil else {
|
||||
guard value != nil && !value!.list.isEmpty else {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user