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:
authorJacques Lucke <jacques@blender.org>2021-08-26 15:35:10 +0300
committerJacques Lucke <jacques@blender.org>2021-08-26 15:35:10 +0300
commit2419ffa183702044ff7e8b78fad8862ca313f12d (patch)
treecc02ebeeb2c5aaa303cd6f2c5fff90712374987f
parentda17692a3df059bf6810998c4abff74cb741292d (diff)
Fix T90959: crash when hovering over empty data block socket
-rw-r--r--source/blender/editors/space_node/node_draw.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc
index 3b1a55f55ab..b67117f1ad0 100644
--- a/source/blender/editors/space_node/node_draw.cc
+++ b/source/blender/editors/space_node/node_draw.cc
@@ -836,9 +836,8 @@ struct SocketTooltipData {
static void create_inspection_string_for_generic_value(const geo_log::GenericValueLog &value_log,
std::stringstream &ss)
{
- auto id_to_inspection_string = [&](ID *id) {
- ss << (id ? id->name + 2 : TIP_("None")) << " (" << BKE_idtype_idcode_to_name(GS(id->name))
- << ")";
+ auto id_to_inspection_string = [&](ID *id, short idcode) {
+ ss << (id ? id->name + 2 : TIP_("None")) << " (" << BKE_idtype_idcode_to_name(idcode) << ")";
};
const GPointer value = value_log.value();
@@ -858,16 +857,16 @@ static void create_inspection_string_for_generic_value(const geo_log::GenericVal
ss << *value.get<std::string>() << TIP_(" (String)");
}
else if (value.is_type<Object *>()) {
- id_to_inspection_string((ID *)*value.get<Object *>());
+ id_to_inspection_string((ID *)*value.get<Object *>(), ID_OB);
}
else if (value.is_type<Material *>()) {
- id_to_inspection_string((ID *)*value.get<Material *>());
+ id_to_inspection_string((ID *)*value.get<Material *>(), ID_MA);
}
else if (value.is_type<Tex *>()) {
- id_to_inspection_string((ID *)*value.get<Tex *>());
+ id_to_inspection_string((ID *)*value.get<Tex *>(), ID_TE);
}
else if (value.is_type<Collection *>()) {
- id_to_inspection_string((ID *)*value.get<Collection *>());
+ id_to_inspection_string((ID *)*value.get<Collection *>(), ID_GR);
}
}