mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 11:35:49 +00:00
Fix unhandled error with empty clipboard on Win32
This commit is contained in:
parent
68b413af5f
commit
c398ef57a5
1 changed files with 5 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue