Avoid NPE when the expected tree is indeed null