Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return an empty string when attempting to paste non-text clipboard buffer #86

Merged
merged 2 commits into from
Oct 1, 2018

Conversation

Riebart
Copy link
Contributor

@Riebart Riebart commented Oct 1, 2018

Returning null Task reference was causing a crash when attempting to paste a non-text buffer.

…ffer.

Returning null Task reference was causing a crash when attempting to paste a non-text buffer.
@@ -13,7 +13,8 @@ public Task<string> GetText()
{
return content.GetTextAsync().AsTask();
}
return null;
// Otherwise return a new task that just sends an empty string.
return new Task<string>(new Func<string>(() => ""));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite possibly. This was yoinked from StackOverflow because modern .NET isn't my forte. 😸

I'll change it.

@felixse
Copy link
Owner

felixse commented Oct 1, 2018

Yeah, I had this happening once and forget to track it, thank you 👍

@felixse felixse merged commit f2a4848 into felixse:master Oct 1, 2018
@Riebart Riebart deleted the non-text-paste-fix branch October 1, 2018 19:51
@felixse felixse added this to the 0.2.1.0 milestone Oct 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants