Added check if new tree data is defined.

This needs to be checked so the tree init is called only once. Otherwise "Uncaught TypeError: Cannot read property 'triggerHandler' of null " is shown in console, because the init is called twice (once when initialising watcher and second time when the watched value changes)