From db8aa50e7bcd2499b2629f3c4f97c4ba0a6a76d1 Mon Sep 17 00:00:00 2001 From: Alexandre Zollinger Chohfi Date: Wed, 5 May 2021 15:14:43 -0700 Subject: [PATCH] Fixed small NRE on UWP and WinUI. --- src/TestFramework/Extension.UWP/UITestMethodAttribute.cs | 2 +- src/TestFramework/Extension.WinUI/UITestMethodAttribute.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TestFramework/Extension.UWP/UITestMethodAttribute.cs b/src/TestFramework/Extension.UWP/UITestMethodAttribute.cs index 6382aee862..8597f61d5b 100644 --- a/src/TestFramework/Extension.UWP/UITestMethodAttribute.cs +++ b/src/TestFramework/Extension.UWP/UITestMethodAttribute.cs @@ -25,7 +25,7 @@ public class UITestMethodAttribute : TestMethodAttribute public override TestResult[] Execute(ITestMethod testMethod) { var attrib = testMethod.GetAttributes(false); - if (attrib.Length > 0) + if (attrib != null && attrib.Length > 0) { throw new NotSupportedException(FrameworkMessages.AsyncUITestMethodNotSupported); } diff --git a/src/TestFramework/Extension.WinUI/UITestMethodAttribute.cs b/src/TestFramework/Extension.WinUI/UITestMethodAttribute.cs index db1d3002d2..391ed8798e 100644 --- a/src/TestFramework/Extension.WinUI/UITestMethodAttribute.cs +++ b/src/TestFramework/Extension.WinUI/UITestMethodAttribute.cs @@ -31,7 +31,7 @@ public class UITestMethodAttribute : TestMethodAttribute public override TestResult[] Execute(ITestMethod testMethod) { var attrib = testMethod.GetAttributes(false); - if (attrib.Length > 0) + if (attrib != null && attrib.Length > 0) { throw new NotSupportedException(FrameworkMessages.AsyncUITestMethodNotSupported); }