Error when changing profile

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue to the add-on author.
Debug info:
Anki 2.1.65 (aa9a734f) Python 3.9.15 Qt 6.4.3 PyQt 6.4.0
Platform: Windows-10-10.0.22621
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-08-14 03:44:18

Traceback (most recent call last):
  File "aqt.main", line 609, in loadCollection
  File "aqt.main", line 712, in moveToState
  File "aqt.main", line 718, in _deckBrowserState
  File "aqt.deckbrowser", line 72, in show
  File "aqt.toolbar", line 284, in redraw
  File "aqt.toolbar", line 404, in update_sync_status
  File "aqt.sync", line 58, in get_sync_status
  File "aqt.taskman", line 62, in run_in_background
  File "decorator", line 232, in fun
  File "anki.hooks", line 89, in decorator_wrapper
  File "anki.hooks", line 86, in repl
  File "C:\Users\Ittipat\AppData\Roaming\Anki2\addons21\1322529746\gui\taskman.py", line 31, in _only_run_in_main_thread
    _old(*args, **kwargs)
  File "aqt.taskman", line 122, in _on_closures_pending
  File "aqt.taskman", line 71, in <lambda>
  File "C:\Users\Ittipat\AppData\Roaming\Anki2\addons21\1322529746\gui\media_sync.py", line 138, in _on_download_finished
    future.result()
  File "concurrent.futures._base", line 439, in result
  File "concurrent.futures._base", line 391, in __get_result
  File "concurrent.futures.thread", line 58, in run
  File "C:\Users\Ittipat\AppData\Roaming\Anki2\addons21\1322529746\gui\media_sync.py", line 114, in _download_missing_media
    missing_media_names = self._missing_media_for_ah_deck(
  File "C:\Users\Ittipat\AppData\Roaming\Anki2\addons21\1322529746\gui\media_sync.py", line 127, in _missing_media_for_ah_deck
    media_dir_path = Path(aqt.mw.col.media.dir())
AttributeError: 'NoneType' object has no attribute 'media'

Can you try deleting the ankihub addon and reinstalling and seeing if the issue still persists?

Thank you for the advice. The issue is quite sporadic but reinstalling AnkiHub seems to fix the problem for now.