Nil value instead zero by default
This commit is contained in:
+3
-3
@@ -142,13 +142,13 @@ func updateContactorsView(msg *yabl.ContactorInternalState) {
|
||||
s.Isolated,
|
||||
s.DebugEnabled)
|
||||
|
||||
if s.ContactorReady == yabl.BOARD_READY_OK {
|
||||
if s.ContactorReady != nil && *s.ContactorReady == yabl.BOARD_READY_OK {
|
||||
p.TextStyle.Bg = ui.ColorClear
|
||||
} else {
|
||||
p.TextStyle.Bg = ui.ColorRed
|
||||
}
|
||||
|
||||
if s.ContactorOn == yabl.ON {
|
||||
if s.ContactorOn != nil && *s.ContactorOn == yabl.ON {
|
||||
p.TitleStyle.Bg = ui.ColorBlue
|
||||
} else {
|
||||
p.TitleStyle.Bg = ui.ColorClear
|
||||
@@ -227,7 +227,7 @@ func updateContactorsStateView(e *yabl.ContactorInternalErrors) {
|
||||
e.Debug,
|
||||
)
|
||||
|
||||
if e.BoardReady == yabl.BOARD_READY_OK {
|
||||
if e.BoardReady != nil && *e.BoardReady == yabl.BOARD_READY_OK {
|
||||
p.TextStyle.Bg = ui.ColorClear
|
||||
} else {
|
||||
p.TextStyle.Bg = ui.ColorRed
|
||||
|
||||
Reference in New Issue
Block a user