mirror of
https://github.com/transmission/transmission
synced 2024-12-27 01:57:52 +00:00
fix: crash regression in GTK client details dialog
This commit is contained in:
parent
76719bf34c
commit
0a85c3aaa4
2 changed files with 7 additions and 1 deletions
|
@ -425,7 +425,7 @@ void buildTree(FileRowNode& node, build_data& build)
|
|||
|
||||
auto const mime_type = isLeaf ? gtr_get_mime_type_from_filename(child_data.name) : DIRECTORY_MIME_TYPE;
|
||||
auto const icon = gtr_get_mime_type_icon(mime_type, Gtk::ICON_SIZE_MENU, *build.w);
|
||||
auto const file = tr_torrentFile(build.tor, child_data.index);
|
||||
auto const file = isLeaf ? tr_torrentFile(build.tor, child_data.index) : tr_file_view{};
|
||||
int const priority = isLeaf ? file.priority : 0;
|
||||
bool const enabled = isLeaf ? file.wanted : true;
|
||||
auto name_esc = Glib::Markup::escape_text(child_data.name);
|
||||
|
|
|
@ -375,6 +375,12 @@ static uint64_t loadName(tr_variant* dict, tr_torrent* tor)
|
|||
return 0;
|
||||
}
|
||||
|
||||
name = tr_strvDup(name);
|
||||
if (std::empty(name))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (name != tr_torrentName(tor))
|
||||
{
|
||||
tr_free(tor->info.name);
|
||||
|
|
Loading…
Reference in a new issue