mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-13 04:54:23 +00:00
Fix unhandled error with empty clipboard on Win32
This commit is contained in:
parent
68b413af5f
commit
c398ef57a5
@ -626,7 +626,11 @@ class AddTorrentDialog(component.Component):
|
||||
import win32clipboard as clip
|
||||
import win32con
|
||||
clip.OpenClipboard()
|
||||
text = clip.GetClipboardData(win32con.CF_UNICODETEXT)
|
||||
try:
|
||||
text = clip.GetClipboardData(win32con.CF_UNICODETEXT)
|
||||
except TypeError:
|
||||
# Catch empty clipboard error
|
||||
text = ''
|
||||
clip.CloseClipboard()
|
||||
else:
|
||||
clip = gtk.clipboard_get(selection='PRIMARY')
|
||||
|
Loading…
x
Reference in New Issue
Block a user