Explorar el Código

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

leonsal hace 8 años
padre
commit
d8a26340d1
Se han modificado 1 ficheros con 1 adiciones y 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