Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2018-07-12 14:37:29 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2018-07-12 14:37:29 +0300
commitc21488df5a830af494d13b353e78cbf81de1595c (patch)
treeb4d5b17d5d2fa5528c9051567cec8f60ff328ae4 /source/blender
parent98c215f4db06c8ad022bb288a02fb0ff424b7de4 (diff)
Fix T55945: Outliner crash
crashed when using filtering and no item was found ('Blender File' mode) Reviewed By: brecht Differential Revision: https://developer.blender.org/D3535
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 9f6c944c914..28890e42139 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -2160,28 +2160,30 @@ void outliner_build_tree(Main *mainvar, Scene *scene, ViewLayer *view_layer, Spa
}
/* make hierarchy */
ten = soops->tree.first;
- ten = ten->next; /* first one is main */
- while (ten) {
- TreeElement *nten = ten->next, *par;
- tselem = TREESTORE(ten);
- lib = (Library *)tselem->id;
- if (lib && lib->parent) {
- par = (TreeElement *)lib->parent->id.newid;
- if (tselem->id->tag & LIB_TAG_INDIRECT) {
- /* Only remove from 'first level' if lib is not also directly used. */
- BLI_remlink(&soops->tree, ten);
- BLI_addtail(&par->subtree, ten);
- ten->parent = par;
- }
- else {
- /* Else, make a new copy of the libtree for our parent. */
- TreeElement *dupten = outliner_add_library_contents(mainvar, soops, &par->subtree, lib);
- if (dupten) {
- dupten->parent = par;
+ if (ten != NULL) {
+ ten = ten->next; /* first one is main */
+ while (ten) {
+ TreeElement *nten = ten->next, *par;
+ tselem = TREESTORE(ten);
+ lib = (Library *)tselem->id;
+ if (lib && lib->parent) {
+ par = (TreeElement *)lib->parent->id.newid;
+ if (tselem->id->tag & LIB_TAG_INDIRECT) {
+ /* Only remove from 'first level' if lib is not also directly used. */
+ BLI_remlink(&soops->tree, ten);
+ BLI_addtail(&par->subtree, ten);
+ ten->parent = par;
+ }
+ else {
+ /* Else, make a new copy of the libtree for our parent. */
+ TreeElement *dupten = outliner_add_library_contents(mainvar, soops, &par->subtree, lib);
+ if (dupten) {
+ dupten->parent = par;
+ }
}
}
+ ten = nten;
}
- ten = nten;
}
/* restore newid pointers */
for (lib = mainvar->library.first; lib; lib = lib->id.next)