瀏覽代碼

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

leonsal 8 年之前
父節點
當前提交
d8a26340d1
共有 1 個文件被更改,包括 1 次插入1 次删除
  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