diff --git a/src/chat_gui4.cpp b/src/chat_gui4.cpp index 7c0d6e26..18ecd56a 100644 --- a/src/chat_gui4.cpp +++ b/src/chat_gui4.cpp @@ -1,5 +1,6 @@ #include "./chat_gui4.hpp" +#include #include #include #include @@ -26,6 +27,7 @@ #include #include #include +#include #include namespace Components { @@ -164,7 +166,15 @@ void ChatGui4::setClipboardData(std::vector mime_types, std::shared // release lock, since on some platforms the callback is called immediatly } - SDL_SetClipboardData(clipboard_callback, nullptr, this, tmp_mimetype_list.data(), tmp_mimetype_list.size()); + try { + SDL_SetClipboardData(clipboard_callback, nullptr, this, tmp_mimetype_list.data(), tmp_mimetype_list.size()); + } catch (const std::runtime_error& e) { + std::cerr << "CG error: setting clipboard data threw runtime_error!\n"; + } catch (const std::exception& e) { + std::cerr << "CG error: setting clipboard data threw exception!\n"; + } catch (...) { + std::cerr << "CG error: setting clipboard data threw!\n"; + } } ChatGui4::ChatGui4(