Errors in nvim startup when using enable_filetree_gitstatus=true with NERDTree
<!-- bug reporting without issue template will be closed automatically -->

## Expected behavior, english is required
nvim starts w/o errors

## The reproduce ways from Vim starting (Required!)
1. start nvim
2. error message is shown:
```
NERDTree: CWD is now: /Users/walhelg/Projects/IE/backend/development
Error detected while processing VimEnter Autocommands for "*"..function SpaceVim#welcome[27]..415[2]..416[19]..422[16]..429[34]..FileType Autocommands for "nerdtree"..funct
ion <SNR>85_nerdtreeinit[15]..User Autocommands for "NERDTreeInit":
E121: Undefined variable: b:NERDTree
Press ENTER or type command to continue
Error detected while processing VimEnter Autocommands for "*"..function SpaceVim#welcome[27]..415[2]..416[19]..422[16]..429[34]..FileType Autocommands for "nerdtree"..funct
ion <SNR>85_nerdtreeinit[15]..User Autocommands for "NERDTreeInit":
E116: Invalid arguments for function s:path2str
Press ENTER or type command to continue
Error detected while processing VimEnter Autocommands for "*"..function SpaceVim#welcome[27]..415[2]..416[19]..422[16]..429[34]..FileType Autocommands for "nerdtree"..funct
ion <SNR>85_nerdtreeinit[15]..User Autocommands for "NERDTreeInit":
E116: Invalid arguments for function <SNR>160_onNERDTreeInit
Press ENTER or type command to continue
```
## Output of the `:SPDebugInfo!`
<details><summary> SpaceVim debug information </summary>

### SpaceVim options :

```toml
  auto_disable_touchpad = 1
  autocomplete_method = 'deoplete'
  autocomplete_parens = 1
  buffer_index_type = 4
  checkinstall = 1
  code_runner_focus = 0
  colorscheme = 'gruvbox'
  colorscheme_bg = 'dark'
  colorscheme_default = 'desert'
  commandline_prompt = '>'
  custom_color_palette = []
  custom_plugins = []
  data_dir = '/Users/walhelg/.cache/'
  debug_level = 0
  default_custom_leader = '<Space>'
  default_indent = 2
  disabled_plugins = []
  enable_bepo_layout = 0
  enable_cursorcolumn = 0
  enable_cursorline = 1
  enable_debug = 0
  enable_googlesuggest = 0
  enable_guicolors = 1
  enable_javacomplete2_py = 0
  enable_key_frequency = 0
  enable_language_specific_leader = 1
  enable_neocomplcache = 0
  enable_os_fileformat_icon = 0
  enable_powerline_fonts = 1
  enable_projects_cache = 1
  enable_statusline_bfpath = 0
  enable_statusline_mode = 1
  enable_statusline_tag = 1
  enable_tabline_filetype_icon = 1
  enable_tabline_ft_icon = 0
  enable_vimfiler_welcome = 1
  enable_ycm = 0
  error_symbol = '✖'
  escape_key_binding = 'jk'
  expand_tab = 1
  file_searching_tools = []
  filemanager = 'nerdtree'
  filetree_direction = 'right'
  filetype_icons = {}
  force_global_config = 0
  gitcommit_issue_icon = ''
  gitcommit_pr_icon = ''
  github_username = ''
  guifont = ''
  hiddenfileinfo = 1
  home_files_number = 6
  hosts_url = 'https://raw.githubusercontent.com/racaljk/hosts/master/hosts'
  info_symbol = 'ⓘ'
  keep_server_alive = 1
  language = ''
  leader_guide_default_group_name = ''
  leader_guide_flatten = 1
  leader_guide_hspace = 5
  leader_guide_max_size = 0
  leader_guide_position = 'botright'
  leader_guide_run_map_on_popup = 1
  leader_guide_sort_horizontal = 0
  leader_guide_submode_mappings = {'<C-C>': 'win_close'}
  leader_guide_vertical = 0
  lint_engine = 'neomake'
  lint_on_save = 1
  lint_on_the_fly = 0
  max_column = 120
  plugin_bundle_dir = '/Users/walhelg/.cache/vimfiles/'
  plugin_manager = 'dein'
  plugin_manager_processes = 16
  plugin_name = 'vim-gitgutter'
  project_auto_root = 1
  project_non_root = ''
  project_rooter_outermost = 1
  project_rooter_patterns = ['.git/', '_darcs/', '.hg/', '.bzr/', '.svn/', 'tsconfig.json']
  projects_cache_num = 20
  realtime_leader_guide = 1
  relativenumber = 1
  search_tools = ['rg', 'ag', 'pt', 'ack', 'grep', 'findstr', 'git']
  sidebar_direction = ''
  sidebar_width = 30
  smartcloseignoreft = ['tagbar', 'vimfiler', 'defx', 'NvimTree', 'SpaceVimRunner', 'SpaceVimREPL', 'SpaceVimQuickFix', 'HelpDescribe', 'VebuggerShell', 'VebuggerTerminal', 'SpaceVimTabsManager']
  smartcloseignorewin = ['__Tagbar__', 'vimfiler:default']
  snippet_engine = 'neosnippet'
  src_root = 'E:\sources\'
  statusline_iseparator = 'arrow'
  statusline_left = ['winnr', 'filename', 'major mode', 'search count', 'syntax checking', 'minor mode lighters', 'vcs', 'hunks']
  statusline_right = ['fileformat', 'cursorpos', 'percentage']
  statusline_separator = 'arrow'
  statusline_unicode = 1
  terminal_cursor_shape = 2
  todo_labels = ['fixme', 'question', 'todo', 'idea']
  todo_prefix = '@'
  update_retry_cnt = 3
  version = '2.1.0-dev'
  vim_help_language = 'en'
  vimcompatible = 0
  warning_symbol = '⚠'
  wildignore = '*/tmp/*,*.so,*.swp,*.zip,*.class,tags,*.jpg,*.ttf,*.TTF,*.png,*/target/*,.git,.svn,.hg,.DS_Store,*.svg'
  windisk_encoding = 'cp936'
  windows_index_type = 3
  windows_leader = 's'
  windows_smartclose = 'q'
  wrap_line = 0
```


### SpaceVim layers :

```toml
[[layers]]
  name="autocomplete"
  auto_completion_return_key_behavior='complete'
  auto_completion_tab_key_behavior='smart'
[[layers]]
  name="checkers"
[[layers]]
  name="format"
[[layers]]
  name="edit"
[[layers]]
  name="ui"
[[layers]]
  name="core"
  enable_filetree_gitstatus=1
  enable_vimfiler_filetypeicon=1
  filetree_show_hidden=1
[[layers]]
  name="core#banner"
[[layers]]
  name="core#statusline"
[[layers]]
  name="core#tabline"
[[layers]]
  name="shell"
  default_shell='VimShell'
  default_position='top'
  default_height=30
[[layers]]
  name="lang#typescript"
[[layers]]
  name="lsp"
  enabled_clients=['typescript']
  filetypes=['typescript']
[[layers]]
  name="git"
[[layers]]
  name="VersionControl"
```


### SpaceVim Health checking :

SpaceVim clipboard support check report:
Checking +clipboard:
      SUCCEED!
SpaceVim environment check report:
Current progpath: nvim(/opt/homebrew/Cellar/neovim/0.8.3/bin/nvim)
version: NVIM v0.8.3
OS: mac
[shell, shellcmdflag, shellslash]: ['/bin/bash', '-c', 0]
SpaceVim lua support check report:
Checking +lua:
      Failed : Known issue, neovim do not support lua now.
SpaceVim python support check report:
Checking +python3:
      SUCCEED!
Checking +python:
      Failed : to support +python, you need run `pip2 install neovim`
Checking SpaceVim layer health:
  - `autocomplete`:ok
  - `checkers`:ok
  - `format`:ok
  - `edit`:ok
  - `ui`:ok
  - `core`:ok
  - `core#banner`:ok
  - `core#statusline`:ok
  - `core#tabline`:ok
  - `shell`:ok
  - `lang#typescript`:ok
  - `lsp`:ok
  - `git`:ok
  - `VersionControl`:ok

### SpaceVim runtime log :

```log
[ SpaceVim ] : logger file  does not exists, only log for current process will be shown!
[ SpaceVim ] [00:00:00:000] [ Info  ] Loading SpaceVim from: /Users/walhelg/.SpaceVim/
[ SpaceVim ] [00:00:00:081] [ Info  ] Startup with no argv, current dir is used: ~/Projects/IE/backend/development
[ SpaceVim ] [00:00:00:081] [ Info  ] init default vim options
[ SpaceVim ] [00:00:00:082] [ Info  ] options init done
[ SpaceVim ] [00:00:00:091] [ Info  ] start loading global config >>>
[ SpaceVim ] [00:00:00:091] [ Info  ] global_dir is: /Users/walhelg/.SpaceVim.d/
[ SpaceVim ] [00:00:00:091] [ Info  ] find global config: /Users/walhelg/.SpaceVim.d/init.toml
[ SpaceVim ] [00:00:00:096] [ Info  ] start to apply config [glob]
[ SpaceVim ] [00:00:00:099] [ Info  ] start loading local config >>>
[ SpaceVim ] [00:00:00:100] [ Info  ] Could not find project local config
[ SpaceVim ] [00:00:00:100] [ Debug ] init default key bindings.
[ SpaceVim ] [00:00:00:100] [ Info  ] SpaceVim server startup at:/tmp/spacevim_nvim_server
[ SpaceVim ] [00:00:00:101] [ Debug ] init g key bindings
[ SpaceVim ] [00:00:00:102] [ Debug ] init z key bindings
[ SpaceVim ] [00:00:00:102] [ Debug ] defind SPC h k prefixs
[ SpaceVim ] [00:00:00:102] [ Debug ] init SPC key bindings
[ SpaceVim ] [00:00:00:115] [ Debug ] init autocomplete layer plugins list.
[ SpaceVim ] [00:00:00:120] [ Debug ] load autocomplete layer config.
[ SpaceVim ] [00:00:00:120] [ Debug ] init checkers layer plugins list.
[ SpaceVim ] [00:00:00:121] [ Debug ] load checkers layer config.
[ SpaceVim ] [00:00:00:122] [ Info  ] the func has been added to mode:syntax-checking
[ SpaceVim ] [00:00:00:122] [ Debug ] init format layer plugins list.
[ SpaceVim ] [00:00:00:122] [ Debug ] load format layer config.
[ SpaceVim ] [00:00:00:122] [ Debug ] init edit layer plugins list.
[ SpaceVim ] [00:00:00:130] [ Debug ] load edit layer config.
[ autosave ] [00:00:00:130] [ Debug ] setup new autosave timer, timeoutlen:300000
[ SpaceVim ] [00:00:00:133] [ Debug ] init ui layer plugins list.
[ SpaceVim ] [00:00:00:137] [ Debug ] load ui layer config.
[ SpaceVim ] [00:00:00:138] [ Info  ] the func has been added to mode:spell-checking
[ SpaceVim ] [00:00:00:138] [ Info  ] the func has been added to mode:paste-mode
[ SpaceVim ] [00:00:00:138] [ Debug ] init core layer plugins list.
[ SpaceVim ] [00:00:00:145] [ Debug ] load core layer config.
[ SpaceVim ] [00:00:00:149] [ Debug ] init core#banner layer plugins list.
[ SpaceVim ] [00:00:00:149] [ Debug ] load core#banner layer config.
[ SpaceVim ] [00:00:00:149] [ Debug ] init core#statusline layer plugins list.
[ SpaceVim ] [00:00:00:149] [ Debug ] load core#statusline layer config.
[ SpaceVim ] [00:00:00:150] [ Debug ] init core#tabline layer plugins list.
[ SpaceVim ] [00:00:00:150] [ Debug ] load core#tabline layer config.
[ SpaceVim ] [00:00:00:151] [ Debug ] init shell layer plugins list.
[ SpaceVim ] [00:00:00:152] [ Debug ] load shell layer config.
[ SpaceVim ] [00:00:00:152] [ Debug ] init lang#typescript layer plugins list.
[ SpaceVim ] [00:00:00:153] [ Debug ] load lang#typescript layer config.
[ SpaceVim ] [00:00:00:155] [ Debug ] init lsp layer plugins list.
[ SpaceVim ] [00:00:00:156] [ Debug ] load lsp layer config.
[ SpaceVim ] [00:00:00:156] [ Info  ] LSP wird konfiguriert
[ SpaceVim ] [00:00:00:156] [ Info  ] nvim-lspconfig is used, do not check enabled_fts
[ SpaceVim ] [00:00:00:156] [ Debug ] init git layer plugins list.
[ SpaceVim ] [00:00:00:156] [ Debug ] load git layer config.
[ SpaceVim ] [00:00:00:157] [ Debug ] init VersionControl layer plugins list.
[ SpaceVim ] [00:00:00:157] [ Debug ] load VersionControl layer config.
[ SpaceVim ] [00:00:00:176] [ Debug ] init SpaceVim_core autocmd group
[ SpaceVim ] [00:00:00:187] [ Info  ] finished loading SpaceVim!
[  project ] [00:00:00:220] [ Debug ] project rooter patterns:{ ".git/", "_darcs/", ".hg/", ".bzr/", ".svn/", "tsconfig.json" }
[  project ] [00:00:00:220] [ Info  ] Load projects cache from: /Users/walhelg/.cache/SpaceVim/projects.json
[  project ] [00:00:00:261] [ Info  ] project_rooter_patterns option has been change, clear b:rootDir
[  project ] [00:00:00:261] [ Debug ] project rooter patterns:{ ".git/", "_darcs/", ".hg/", ".bzr/", ".svn/", "tsconfig.json" }
[  project ] [00:00:00:261] [ Debug ] previous buffer does not exist, use current directory instead!
[  project ] [00:00:00:261] [ Debug ] start to find root for: /Users/walhelg/Projects/IE/backend/development/
[  project ] [00:00:00:263] [ Info  ]         (.git/):/Users/walhelg/Projects/IE/backend/development/
[  project ] [00:00:00:265] [ Info  ]         (tsconfig.json):/Users/walhelg/Projects/IE/backend/development/
[ SpaceVim ] [00:00:00:265] [ Info  ] try to open SpaceVim welcome page
[ SpaceVim ] [00:01:48:340] [ Info  ] run root changed callback on VimEnter!
[  project ] [00:01:48:340] [ Info  ] switch to project:[development]
[  project ] [00:01:48:340] [ Info  ]        rootdir is:/Users/walhelg/Projects/IE/backend/development/
[  project ] [00:01:48:341] [ Debug ]      run callback:git#branch#detect
[ SpaceVim ] [00:01:54:610] [ Info  ] the func has been added to mode:syntax-checking
[ SpaceVim ] [00:01:54:615] [ Info  ] the func has been added to mode:spell-checking
[ SpaceVim ] [00:01:54:615] [ Info  ] the func has been added to mode:paste-mode
[ SpaceVim ] [00:01:54:620] [ Info  ] LSP wird konfiguriert
[ SpaceVim ] [00:01:54:620] [ Info  ] nvim-lspconfig is used, do not check enabled_fts
[ SpaceVim ] [00:01:54:621] [ Info  ] statusline build-in section vcs has been changed!
[ SpaceVim ] [00:01:54:621] [ Info  ] statusline build-in section hunks has been changed!

```
</details>



## Screenshots
![image](https://user-images.githubusercontent.com/3379442/228122125-3d77248b-45cf-47f6-a5c8-cb8f98bc61a5.png)

If you have any screenshots for this issue, please upload here. BTW you can use https://asciinema.org/ for recording video in terminal.

<!-- please remove the issue template when request for a feature -->
