mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-20 11:12:55 +00:00
Handled nullable content and improved null checks in MudCopyClipboardButton.
This commit is contained in:
parent
e4cd2a75a1
commit
eca0d33da3
@ -48,10 +48,10 @@ public partial class MudCopyClipboardButton : ComponentBase
|
||||
|
||||
private async Task HandleCopyClick()
|
||||
{
|
||||
if (this.Type == ContentType.NONE)
|
||||
if (this.Type is ContentType.NONE)
|
||||
await this.CopyToClipboard(this.StringContent);
|
||||
else
|
||||
await this.CopyToClipboard(this.Content!);
|
||||
await this.CopyToClipboard(this.Content);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -65,8 +65,11 @@ public partial class MudCopyClipboardButton : ComponentBase
|
||||
/// <summary>
|
||||
/// Copy this block's content to the clipboard.
|
||||
/// </summary>
|
||||
private async Task CopyToClipboard(IContent contentToCopy)
|
||||
private async Task CopyToClipboard(IContent? contentToCopy)
|
||||
{
|
||||
if (contentToCopy is null)
|
||||
return;
|
||||
|
||||
switch (this.Type)
|
||||
{
|
||||
case ContentType.TEXT:
|
||||
|
Loading…
Reference in New Issue
Block a user