fix: fix warnings in test related code.

This commit is contained in:
rabbitism
2024-11-06 18:44:49 +08:00
parent 6ef0cf9e1c
commit 186424b848
2 changed files with 4 additions and 3 deletions

View File

@@ -162,10 +162,11 @@ public class PinCode: TemplatedControl
protected async void OnPreviewKeyDown(KeyEventArgs e)
{
TextBox b = new TextBox();
var pasteKeys = Application.Current?.PlatformSettings.HotkeyConfiguration.Paste;
var pasteKeys = Application.Current?.PlatformSettings?.HotkeyConfiguration.Paste;
if (pasteKeys?.Any(a => a.Matches(e)) == true)
{
var clipboard = TopLevel.GetTopLevel(this)?.Clipboard;
if (clipboard is null) return;
var text = await clipboard.GetTextAsync();
if (text is not null)
{