Fixed possible crash in DetailsDialog::setFileHash by checking return value of dynamic_cast.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8596 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2015-07-12 01:19:28 +00:00
parent 865a45f294
commit 8691a911aa

View File

@ -101,7 +101,10 @@ DetailsDialog::show()
void DetailsDialog::setFileHash(const RsFileHash & hash)
{
dynamic_cast<FileTransferInfoWidget*>(ui.fileTransferInfoWidget->widget())->setFileHash(hash) ;
FileTransferInfoWidget *ftiWidget = dynamic_cast<FileTransferInfoWidget*>(ui.fileTransferInfoWidget->widget());
if (ftiWidget) {
ftiWidget->setFileHash(hash) ;
}
FileInfo nfo ;
if(!rsFiles->FileDetails(hash, RS_FILE_HINTS_DOWNLOAD, nfo))