From 69cb8d1398c7efda842e0a1723313c8a77c3a037 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 13 Dec 2009 00:34:54 +0000 Subject: [PATCH] - Fix possible crash in torrent properties --- src/propertieswidget.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/propertieswidget.cpp b/src/propertieswidget.cpp index ce2a2bb20..f9a66adab 100644 --- a/src/propertieswidget.cpp +++ b/src/propertieswidget.cpp @@ -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 fp; h.file_progress(fp); PropListModel->updateFilesPriorities(h.file_priorities());