diff options
-rw-r--r-- | source/blender/blenkernel/intern/lib_query.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/lib_query.c b/source/blender/blenkernel/intern/lib_query.c index fcbb1458749..4b4d744c41a 100644 --- a/source/blender/blenkernel/intern/lib_query.c +++ b/source/blender/blenkernel/intern/lib_query.c @@ -528,7 +528,10 @@ static void library_foreach_ID_link(Main *bmain, SEQ_END; } - library_foreach_collection(&data, scene->master_collection); + /* This pointer can be NULL during old files reading, better be safe than sorry. */ + if (scene->master_collection != NULL) { + library_foreach_collection(&data, scene->master_collection); + } ViewLayer *view_layer; for (view_layer = scene->view_layers.first; view_layer; view_layer = view_layer->next) { @@ -1030,13 +1033,15 @@ static void library_foreach_ID_link(Main *bmain, wmWindowManager *wm = (wmWindowManager *)id; for (wmWindow *win = wm->windows.first; win; win = win->next) { - ID *workspace = (ID *)BKE_workspace_active_get(win->workspace_hook); - CALLBACK_INVOKE(win->scene, IDWALK_CB_USER_ONE); - CALLBACK_INVOKE_ID(workspace, IDWALK_CB_NOP); - /* allow callback to set a different workspace */ - BKE_workspace_active_set(win->workspace_hook, (WorkSpace *)workspace); + /* This pointer can be NULL during old files reading, better be safe than sorry. */ + if (win->workspace_hook != NULL) { + ID *workspace = (ID *)BKE_workspace_active_get(win->workspace_hook); + CALLBACK_INVOKE_ID(workspace, IDWALK_CB_NOP); + /* allow callback to set a different workspace */ + BKE_workspace_active_set(win->workspace_hook, (WorkSpace *)workspace); + } } break; } |