Explorar o código

Checks if root is nil when subscribing to root panel in CheckRadio.SetRoot()

leonsal %!s(int64=8) %!d(string=hai) anos
pai
achega
d8a26340d1
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      gui/checkradio.go

+ 1 - 1
gui/checkradio.go

@@ -104,7 +104,7 @@ func newCheckRadio(check bool, text string) *CheckRadio {
 // SetRoot overrides the IPanel.SetRoot method
 func (cb *CheckRadio) SetRoot(root *Root) {
 
-	if cb.root == root {
+	if cb.root == root || root == nil {
 		return
 	}
 	cb.root = root