summaryrefslogtreecommitdiff
path: root/protocols/WhatsApp/src/utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/WhatsApp/src/utils.cpp')
-rw-r--r--protocols/WhatsApp/src/utils.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/protocols/WhatsApp/src/utils.cpp b/protocols/WhatsApp/src/utils.cpp
index 4458f976f0..946e581bbd 100644
--- a/protocols/WhatsApp/src/utils.cpp
+++ b/protocols/WhatsApp/src/utils.cpp
@@ -14,7 +14,9 @@ void utils::copyText(HWND hwnd, const TCHAR *text)
{
if (!hwnd || !text) return;
- OpenClipboard(hwnd);
+ if (!OpenClipboard(hwnd))
+ return;
+
EmptyClipboard();
HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(mir_tstrlen(text) + 1));
mir_tstrcpy((TCHAR*)GlobalLock(hMem), text);