canneverbe / Ketarin

Ketarin - application download helper
http://ketarin.org/
Other
135 stars 19 forks source link

Fix issue on Mono/Linux with random crashes #8

Closed franc6 closed 5 years ago

franc6 commented 5 years ago

Clipboard.GetDataObject() returns null sometimes on Linux. Modified code to check for null. Also modified code to catch all exceptions in SafeClipboard.IsDataPresent and SafeClipboard.GetData. This prevents the methods from passing exceptions to calling code, which might not expect to see exceptions.

Note: I noticed a couple of different methods for catching all exceptions in the codebase. If this is not your preferred method, let me know, and I'll change it.