This version of Unity is unsupported.

TreeViewItem.hasChildren

public bool hasChildren;

Description

Returns true if children has any items.