diff --git a/src/webui/api/torrentscontroller.cpp b/src/webui/api/torrentscontroller.cpp index 3c77c5edc..0c6869cc5 100644 --- a/src/webui/api/torrentscontroller.cpp +++ b/src/webui/api/torrentscontroller.cpp @@ -717,7 +717,8 @@ void TorrentsController::addAction() } } - for (auto it = data().constBegin(); it != data().constEnd(); ++it) + const DataMap torrents = data(); + for (auto it = torrents.constBegin(); it != torrents.constEnd(); ++it) { const nonstd::expected result = BitTorrent::TorrentInfo::load(it.value()); if (!result)