Skip to content

Commit 003ff38

Browse files
committed
Fix exception when dragging files in the unstaged and staged changes table views
Use setPropertyList:forType: to silence this exception when dragging: There are 2 items on the pasteboard, but 1 drag images. There must be 1 draggingItem per pasteboardItem.
1 parent eece2fc commit 003ff38

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Classes/Controllers/PBGitCommitController.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -670,11 +670,11 @@ - (BOOL)tableView:(NSTableView *)tv writeRowsWithIndexes:(NSIndexSet *)rowIndexe
670670
NSArray *files = [controller.arrangedObjects objectsAtIndexes:rowIndexes];
671671
NSURL *workingDirectoryURL = self.repository.workingDirectoryURL;
672672

673-
NSMutableArray<NSURL *> *URLs = [NSMutableArray arrayWithCapacity:rowIndexes.count];
673+
NSMutableArray<NSString *> *paths = [NSMutableArray arrayWithCapacity:rowIndexes.count];
674674
for (PBChangedFile *file in files) {
675-
[URLs addObject:[workingDirectoryURL URLByAppendingPathComponent:file.path]];
675+
[paths addObject:[[workingDirectoryURL URLByAppendingPathComponent:file.path] path]];
676676
}
677-
[pboard writeObjects:URLs];
677+
[pboard setPropertyList:paths forType:NSFilenamesPboardType];
678678

679679
return YES;
680680
}

0 commit comments

Comments
 (0)