Don't create tree when udfc data is empty

fixes #1077 on github
Merge pull request #1689 from steventlamb/topic/dont_create_tree

Topic/dont create tree
Factor out dotted split