Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MKleusberg committed Dec 4, 2017
1 parent b3a0c57 commit 9db70e0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ExtendedTableWidget.cpp
Expand Up @@ -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)");
Expand Down

0 comments on commit 9db70e0

Please sign in to comment.