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:
authorJulian Eisel <julian@blender.org>2020-12-07 16:14:31 +0300
committerJulian Eisel <julian@blender.org>2020-12-07 16:35:54 +0300
commit634b10acbb6962f9901f0ad610d12b24f7d76c06 (patch)
tree2fca26a010991ca45173d0b0ff9a51a6f19b9c36
parent95734e32bfb9d4309e05a69e41aa1b1676d42447 (diff)
Fix missing type check for Outliner eyedropper query
Mistake in 35a5dee2ef73. Code would simply assume that the element under the cursor is an Object if it was an ID (but not a collection). This wouldn't cause any issues in current code, since the only other ID that set the direct-data were collections, which are special in that they don't have a `TreeStoreElem.type` of 0, which is already being checked for here. And if there was no direct-data set, the object lookup in the View-Layer would correctly fail too.
-rw-r--r--source/blender/editors/space_outliner/outliner_utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/space_outliner/outliner_utils.c b/source/blender/editors/space_outliner/outliner_utils.c
index fe4cc29b738..e0d63dfcf81 100644
--- a/source/blender/editors/space_outliner/outliner_utils.c
+++ b/source/blender/editors/space_outliner/outliner_utils.c
@@ -510,7 +510,7 @@ Base *ED_outliner_give_base_under_cursor(bContext *C, const int mval[2])
te = outliner_find_item_at_y(space_outliner, &space_outliner->tree, view_mval[1]);
if (te) {
TreeStoreElem *tselem = TREESTORE(te);
- if (tselem->type == 0) {
+ if ((tselem->type == 0) && (te->idcode == ID_OB)) {
Object *ob = (Object *)tselem->id;
base = (te->directdata) ? (Base *)te->directdata : BKE_view_layer_base_find(view_layer, ob);
}