From 05b1fba609f62271c00e2be218a7e6004c9904fb Mon Sep 17 00:00:00 2001 From: Dihan Britz Date: Sun, 8 Mar 2026 21:57:17 +0200 Subject: [PATCH] Potential fix for code scanning alert no. 34: Cast to same type Simplification of datatype casting Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- src/TypeGuard.Winforms/WinFormsInput.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TypeGuard.Winforms/WinFormsInput.cs b/src/TypeGuard.Winforms/WinFormsInput.cs index b2aa7c6..932d98d 100644 --- a/src/TypeGuard.Winforms/WinFormsInput.cs +++ b/src/TypeGuard.Winforms/WinFormsInput.cs @@ -42,7 +42,7 @@ public class WinFormsInput(Control control) : IInputProvider public string? GetInput() { string? text = _control.InvokeRequired - ? (string?)_control.Invoke(() => _control.Text) + ? _control.Invoke(() => _control.Text) : _control.Text; return string.IsNullOrEmpty(text) ? null : text.Trim();