private boolean treeExists(String treeName) {
		if (currentProgram == null && treeName.equals(DEFAULT_TREE_NAME)) {
			return true;
		}
		else if (currentProgram == null) {
			return false;
		}
		return currentProgram.getListing().getRootModule(treeName) != null;
	}
Return true if a tree with the given name exists in the program. If
program is null and if the tree name is the default name, return true.

@param treeName tree name to look for
@return boolean
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ProgramTreePlugin.java