fix: Windows, avoid encoding empty data to the clipboard
Do not attempt to convert null data to clipboard format and exit early
This commit is contained in:
parent
252d11a316
commit
53b9c0908e
1 changed files with 5 additions and 0 deletions
|
|
@ -96,6 +96,11 @@ bool MSWindowsClipboard::empty()
|
||||||
|
|
||||||
void MSWindowsClipboard::add(EFormat format, const String &data)
|
void MSWindowsClipboard::add(EFormat format, const String &data)
|
||||||
{
|
{
|
||||||
|
// exit early if there is no data to prevent spurious "failed to convert clipboard data" errors
|
||||||
|
if (data.empty()) {
|
||||||
|
LOG((CLOG_DEBUG "not adding 0 bytes to clipboard format: %d", format));
|
||||||
|
return;
|
||||||
|
}
|
||||||
bool isSucceeded = false;
|
bool isSucceeded = false;
|
||||||
// convert data to win32 form
|
// convert data to win32 form
|
||||||
for (ConverterList::const_iterator index = m_converters.begin(); index != m_converters.end(); ++index) {
|
for (ConverterList::const_iterator index = m_converters.begin(); index != m_converters.end(); ++index) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue