mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 04:54:18 +00:00
- Fix crashes when handling torrents without metadata (magnet URIs) from Web UI
This commit is contained in:
parent
b976d39207
commit
8c1a135d16
@ -94,7 +94,7 @@ QList<QVariantMap> EventManager::getPropTrackersInfo(QString hash) const {
|
|||||||
QList<QVariantMap> EventManager::getPropFilesInfo(QString hash) const {
|
QList<QVariantMap> EventManager::getPropFilesInfo(QString hash) const {
|
||||||
QList<QVariantMap> files;
|
QList<QVariantMap> files;
|
||||||
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
||||||
if(!h.is_valid()) return files;
|
if(!h.is_valid() || !h.has_metadata()) return files;
|
||||||
std::vector<int> priorities = h.file_priorities();
|
std::vector<int> priorities = h.file_priorities();
|
||||||
std::vector<size_type> fp;
|
std::vector<size_type> fp;
|
||||||
h.file_progress(fp);
|
h.file_progress(fp);
|
||||||
@ -136,7 +136,7 @@ QVariantMap EventManager::getGlobalPreferences() const {
|
|||||||
QVariantMap EventManager::getPropGeneralInfo(QString hash) const {
|
QVariantMap EventManager::getPropGeneralInfo(QString hash) const {
|
||||||
QVariantMap data;
|
QVariantMap data;
|
||||||
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
||||||
if(h.is_valid()) {
|
if(h.is_valid() && h.has_metadata()) {
|
||||||
// Save path
|
// Save path
|
||||||
data["save_path"] = TorrentPersistentData::getSavePath(hash);
|
data["save_path"] = TorrentPersistentData::getSavePath(hash);
|
||||||
// Creation date
|
// Creation date
|
||||||
|
Loading…
x
Reference in New Issue
Block a user