Skip to content

Commit 980fc4b

Browse files
committed
Use ??= instead of =
1 parent fee5d08 commit 980fc4b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Main.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,13 @@ public FilesTab(AutomationElement Files)
111111
// Find window content to reduce the scope
112112
AutomationElement _windowContent = Files.FindFirstChild(cf => cf.ByClassName("Microsoft.UI.Content.DesktopChildSiteBridge"));
113113

114-
_currentPathGet = _windowContent.FindFirstChild(cf => cf.ByAutomationId("CurrentPathGet"))?.AsTextBox();
114+
_currentPathGet ??= _windowContent.FindFirstChild(cf => cf.ByAutomationId("CurrentPathGet"))?.AsTextBox();
115115
if (_currentPathGet == null)
116116
{
117117
Context.API.LogError(ClassName, "Failed to find CurrentPathGet");
118118
}
119119

120-
_currentPathSet = _windowContent.FindFirstChild(cf => cf.ByAutomationId("CurrentPathSet"))?.AsTextBox();
120+
_currentPathSet ??= _windowContent.FindFirstChild(cf => cf.ByAutomationId("CurrentPathSet"))?.AsTextBox();
121121
if (_currentPathSet == null)
122122
{
123123
Context.API.LogError(ClassName, "Failed to find CurrentPathSet");

0 commit comments

Comments
 (0)