Parameter type check on plugin init

Added a type check for the tree parameter in the init() method, to handle when the plugin is used via "viewConfig"