registry cachehook: compare cache_tree against NULL, not 0.