mirror of
https://github.com/grishka/NearDrop.git
synced 2026-04-03 01:36:15 +02:00
Support receiving links and properly reject unsupported attachments
closes #52, closes #73, closes #16, closes #3, closes #8
This commit is contained in:
@@ -116,7 +116,7 @@ class ShareViewController: NSViewController, ShareExtensionDelegate{
|
||||
private func urlsReady(){
|
||||
for url in urls{
|
||||
if url.isFileURL{
|
||||
var isDirectory=UnsafeMutablePointer<ObjCBool>.allocate(capacity: 1)
|
||||
let isDirectory=UnsafeMutablePointer<ObjCBool>.allocate(capacity: 1)
|
||||
if FileManager.default.fileExists(atPath: url.path, isDirectory: isDirectory) && isDirectory.pointee.boolValue{
|
||||
print("Canceling share request because URL \(url) is a directory")
|
||||
let cancelError = NSError(domain: NSCocoaErrorDomain, code: NSUserCancelledError, userInfo: nil)
|
||||
|
||||
Reference in New Issue
Block a user