Przeglądaj źródła

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

leonsal 8 lat temu
rodzic
commit
d8a26340d1
1 zmienionych plików z 1 dodań i 1 usunięć
  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