From cd5d6de0034c864e34b42c24e4a87d0681a26e87 Mon Sep 17 00:00:00 2001 From: ZestyTS Date: Thu, 5 Oct 2023 15:25:11 -0700 Subject: [PATCH] Fixed this item that's annoying when debugging --- UWUVCI AIO WPF/Classes/MenuIconImage.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/UWUVCI AIO WPF/Classes/MenuIconImage.cs b/UWUVCI AIO WPF/Classes/MenuIconImage.cs index 7ee91dd..00fd2b9 100644 --- a/UWUVCI AIO WPF/Classes/MenuIconImage.cs +++ b/UWUVCI AIO WPF/Classes/MenuIconImage.cs @@ -1,6 +1,7 @@ using System; using System.Drawing; using System.Drawing.Drawing2D; +using System.Reflection; namespace UWUVCI_AIO_WPF.Classes { @@ -90,7 +91,12 @@ namespace UWUVCI_AIO_WPF.Classes Rectangle rectangle; try { - rectangle = (Rectangle)GetType().GetField(_imageVar).GetValue(this); + FieldInfo fieldInfo = GetType().GetField(_imageVar, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); + + rectangle = fieldInfo != null + ? (Rectangle)fieldInfo.GetValue(this) + : _rectangleH4V3; + } catch {