diff options
| author | hhvn <dev@hhvn.uk> | 2023-11-16 18:44:30 +0000 |
|---|---|---|
| committer | hhvn <dev@hhvn.uk> | 2023-11-16 18:44:30 +0000 |
| commit | feffd883dce08ada407c67810f522bd2790cb6b0 (patch) | |
| tree | 6c0dd77a12e81656e5db07046922341b8a860bcc /bar/bar.go | |
| parent | 049e9d9f5265c20e6a43d69327981d32f00ecd54 (diff) | |
If a bar's Mon is nil, then don't segfault
Diffstat (limited to 'bar/bar.go')
| -rw-r--r-- | bar/bar.go | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -162,7 +162,9 @@ func (b *bar) draw() { } func (b *bar) destroy() { - b.Mon.TopPadding(0) + if (b.Mon != nil) { + b.Mon.TopPadding(0) + } xproto.DestroyWindow(b.X, b.w) } @@ -274,7 +276,9 @@ func init() { case state = <- Handle.NewState: for _, b := range bars { b.Mon = state.GetMon(b.Mon.ID) - go b.draw() + if b.Mon != nil { + go b.draw() + } } case <- stoploop: return |