- Fix possible crash in torrent properties (files)

This commit is contained in:
Christophe Dumez
2009-12-13 00:44:47 +00:00
parent b315551edd
commit aac0fbcbe4
2 changed files with 7 additions and 1 deletions

View File

@@ -362,7 +362,12 @@ void PropertiesWidget::loadDynamicData() {
}
if(stackedProperties->currentIndex() == FILES_TAB) {
// Files progress
if(h.has_metadata()) {
if(h.is_valid() && h.has_metadata()) {
if(PropListModel->rowCount() == 0) {
PropListModel->setupModelData(h.get_torrent_info());
// Expand first item if possible
filesList->expand(PropListModel->index(0, 0));
}
std::vector<size_type> fp;
h.file_progress(fp);
PropListModel->updateFilesPriorities(h.file_priorities());