def safe_join(tree, path): return tree.join(path) if path else tree