Don't paste NULL value when pasting from empty clipboard

When the clipboard is empty and trying to paste from it we would set the
selected field to NULL. This is fixed by this commit, so that nothing
happens.
This commit is contained in:
Martin Kleusberg
2017-12-04 12:44:35 +01:00
parent b3a0c574e8
commit 9db70e0750

View File

@@ -32,8 +32,11 @@ QList<QStringList> parseClipboard(QString clipboard)
if(clipboard.endsWith("\r"))
clipboard.chop(1);
// Prepare result list
// Make sure there is some data in the clipboard
QList<QStringList> result;
if(clipboard.isEmpty())
return result;
result.push_back(QStringList());
QRegExp re("(\"(?:[^\t\"]+|\"\"[^\"]*\"\")*)\"|(\t|\r?\n)");