From: Mike Gelfand Date: Tue, 4 Jul 2017 19:59:55 +0000 (+0300) Subject: Uncaught exception when dragging multiple items between groups (macOS) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5bdd4f4d7a1e249c1b9f5037d52f169ac4751305;p=transmission Uncaught exception when dragging multiple items between groups (macOS) Change group after all the torrents are retrieved from drop data to avoid premature view item index changes. Fixes: #51 --- diff --git a/macosx/Controller.m b/macosx/Controller.m index 9075bd75d..7f924747f 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -3125,10 +3125,15 @@ static void removeKeRangerRansomware() { Torrent * torrent = [fTableView itemAtRow: i]; [movingTorrents addObject: torrent]; + } - //change groups - if (item) - [torrent setGroupValue: [item groupIndex] determinationType: TorrentDeterminationUserSpecified]; + //change groups + if (item) + { + const NSInteger groupIndex = [item groupIndex]; + + for (Torrent * torrent in movingTorrents) + [torrent setGroupValue: groupIndex determinationType: TorrentDeterminationUserSpecified]; } //reorder queue order