diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index 39c4c0743e9..37a21a3c14b 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -684,8 +684,11 @@ static void reset_tree_ui_storage(Span tree static Vector find_spreadsheet_editors(Main *bmain) { - Vector spreadsheets; wmWindowManager *wm = (wmWindowManager *)bmain->wm.first; + if (wm == nullptr) { + return {}; + } + Vector spreadsheets; LISTBASE_FOREACH (wmWindow *, window, &wm->windows) { bScreen *screen = BKE_workspace_active_screen_get(window->workspace_hook); LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {