Don't copy if there's nothing to copy

This commit is contained in:
Douwe Maan 2017-01-16 18:12:42 -05:00
parent bc3448fc48
commit 5adf080880

View file

@ -239,6 +239,8 @@
let selectedDocument = selection.getRangeAt(0).cloneContents();
if (!selectedDocument) return;
if (selectedDocument.textContent.length === 0) return;
e.preventDefault();
clipboardData.setData('text/plain', selectedDocument.textContent);