Skip to content

Commit 0473841

Browse files
committed
Fix build warnings
Fix build warnings introduced after the update to FlaUI 5, which adds nullable support.
1 parent df671a2 commit 0473841

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/FlaUI.WebDriver/Controllers/ElementController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,11 @@ public async Task<ActionResult> IsElementSelected([FromRoute] string sessionId,
174174
var isSelected = false;
175175
if (element.Patterns.SelectionItem.IsSupported)
176176
{
177-
isSelected = element.Patterns.SelectionItem.PatternOrDefault.IsSelected.ValueOrDefault;
177+
isSelected = element.Patterns.SelectionItem.TryGetPattern(out var pattern) && pattern.IsSelected.ValueOrDefault;
178178
}
179179
else if (element.Patterns.Toggle.IsSupported)
180180
{
181-
isSelected = element.Patterns.Toggle.PatternOrDefault.ToggleState.ValueOrDefault == Core.Definitions.ToggleState.On;
181+
isSelected = element.Patterns.Toggle.PatternOrDefault?.ToggleState.ValueOrDefault == Core.Definitions.ToggleState.On;
182182
}
183183
return await Task.FromResult(WebDriverResult.Success(isSelected));
184184
}

src/FlaUI.WebDriver/Controllers/SessionController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public async Task<ActionResult> CreateNewSession([FromBody] CreateSessionRequest
9191
if (appPath.EndsWith("!App"))
9292
{
9393
isAppOwnedBySession = true;
94-
return Application.LaunchStoreApp(appPath, appArguments);
94+
return Application.LaunchStoreApp(appPath, appArguments ?? "");
9595
}
9696

9797
var processStartInfo = new ProcessStartInfo(appPath, appArguments ?? "");

0 commit comments

Comments
 (0)